Merge remote-tracking branch 'aleric/meshupload' into meshupload

This commit is contained in:
Latif Khalifa
2013-01-30 03:46:45 +01:00
3 changed files with 17 additions and 25 deletions

View File

@@ -44,8 +44,8 @@ class HelloWorldThread : public AIThreadImpl {
public: public:
// Constructor. // Constructor.
HelloWorldThread(AIStateMachineThreadBase* state_machine_thread) : // MAIN THREAD HelloWorldThread(void) : AIThreadImpl("HelloWorldThread"), // MAIN THREAD
AIThreadImpl(state_machine_thread, "HelloWorldThread"), mStdErr(false), mSuccess(false) { } mStdErr(false), mSuccess(false) { }
// Some initialization function (if needed). // Some initialization function (if needed).
void init(bool err) { mStdErr = err; } // MAIN THREAD void init(bool err) { mStdErr = err; } // MAIN THREAD
@@ -152,24 +152,21 @@ class AIStateMachineThreadBase;
// Derive from this to implement the code that must run in another thread. // Derive from this to implement the code that must run in another thread.
class AIThreadImpl : public LLThreadSafeRefCount { class AIThreadImpl : public LLThreadSafeRefCount {
private: private:
template<typename THREAD_IMPL> friend struct AIStateMachineThread;
typedef AIAccess<AIStateMachineThreadBase*> StateMachineThread_wat; typedef AIAccess<AIStateMachineThreadBase*> StateMachineThread_wat;
AIThreadSafeSimpleDC<AIStateMachineThreadBase*> mStateMachineThread; AIThreadSafeSimpleDC<AIStateMachineThreadBase*> mStateMachineThread;
#ifdef LL_DEBUG
char const* mName;
#endif
protected:
AIThreadImpl(AIStateMachineThreadBase* state_machine_thread, char const* name = "AIStateMachineThreadBase::Thread") : mStateMachineThread(state_machine_thread)
#ifdef LL_DEBUG
, mName(name)
#endif
{ }
public: public:
virtual bool run(void) = 0; virtual bool run(void) = 0;
bool thread_done(bool result); bool thread_done(bool result);
bool state_machine_done(LLThread* threadp); bool state_machine_done(LLThread* threadp);
#ifdef LL_DEBUG #ifdef LL_DEBUG
private:
char const* mName;
protected:
AIThreadImpl(char const* name = "AIStateMachineThreadBase::Thread") : mName(name) { }
public:
char const* getName(void) const { return mName; } char const* getName(void) const { return mName; }
#endif #endif
}; };
@@ -221,9 +218,11 @@ template<typename THREAD_IMPL>
struct AIStateMachineThread : public LLPointer<THREAD_IMPL>, public AIStateMachineThreadBase { struct AIStateMachineThread : public LLPointer<THREAD_IMPL>, public AIStateMachineThreadBase {
// Constructor. // Constructor.
AIStateMachineThread(void) : AIStateMachineThread(void) :
LLPointer<THREAD_IMPL>(new THREAD_IMPL(this)), LLPointer<THREAD_IMPL>(new THREAD_IMPL),
AIStateMachineThreadBase(LLPointer<THREAD_IMPL>::get()) AIStateMachineThreadBase(LLPointer<THREAD_IMPL>::get())
{ } {
*AIThreadImpl::StateMachineThread_wat(static_cast<AIThreadImpl*>(LLPointer<THREAD_IMPL>::get())->mStateMachineThread) = this;
}
}; };
#endif #endif

View File

@@ -1270,10 +1270,6 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32
return true; return true;
} }
LLMeshUploadThread::LLMeshUploadThread(AIStateMachineThreadBase* state_machine_thread) : AIThreadImpl(state_machine_thread, "mesh upload")
{
}
void LLMeshUploadThread::init(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures, void LLMeshUploadThread::init(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, bool do_upload, bool upload_skin, bool upload_joints, bool do_upload,
LLHandle<LLWholeModelFeeObserver> const& fee_observer, LLHandle<LLWholeModelUploadObserver> const& upload_observer) LLHandle<LLWholeModelFeeObserver> const& fee_observer, LLHandle<LLWholeModelUploadObserver> const& upload_observer)
@@ -1295,11 +1291,6 @@ void LLMeshUploadThread::init(LLMeshUploadThread::instance_list& data, LLVector3
mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut") ; mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut") ;
} }
LLMeshUploadThread::~LLMeshUploadThread()
{
}
LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread) LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread)
{ {
mStage = "single_hull"; mStage = "single_hull";

View File

@@ -394,10 +394,12 @@ public:
LLHost mHost; LLHost mHost;
std::string mWholeModelFeeCapability; std::string mWholeModelFeeCapability;
LLMeshUploadThread(AIStateMachineThreadBase* state_machine_thread); #ifdef LL_DEBUG
~LLMeshUploadThread(); LLMeshUploadThread(void) : AIThreadImpl("mesh upload") { }
#endif
void init(instance_list& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool do_upload, void init(instance_list& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool do_upload,
LLHandle<LLWholeModelFeeObserver> const& fee_observer, LLHandle<LLWholeModelUploadObserver> const& upload_observer); LLHandle<LLWholeModelFeeObserver> const& fee_observer, LLHandle<LLWholeModelUploadObserver> const& upload_observer);
void postRequest(std::string& url, AIMeshUpload* state_machine); void postRequest(std::string& url, AIMeshUpload* state_machine);
/*virtual*/ bool run(); /*virtual*/ bool run();