Remove AIStateMachineThreadBase* argument from AIThreadImpl constructor.

Also removes the use of 'this' to initialize base classes, which led to
a compiler warning on vs2010.
This commit is contained in:
Aleric Inglewood
2013-01-30 03:44:02 +01:00
parent 1d673df1bd
commit 9203b24eb9
3 changed files with 17 additions and 25 deletions

View File

@@ -44,8 +44,8 @@ class HelloWorldThread : public AIThreadImpl {
public:
// Constructor.
HelloWorldThread(AIStateMachineThreadBase* state_machine_thread) : // MAIN THREAD
AIThreadImpl(state_machine_thread, "HelloWorldThread"), mStdErr(false), mSuccess(false) { }
HelloWorldThread(void) : AIThreadImpl("HelloWorldThread"), // MAIN THREAD
mStdErr(false), mSuccess(false) { }
// Some initialization function (if needed).
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.
class AIThreadImpl : public LLThreadSafeRefCount {
private:
template<typename THREAD_IMPL> friend struct AIStateMachineThread;
typedef AIAccess<AIStateMachineThreadBase*> StateMachineThread_wat;
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:
virtual bool run(void) = 0;
bool thread_done(bool result);
bool state_machine_done(LLThread* threadp);
#ifdef LL_DEBUG
private:
char const* mName;
protected:
AIThreadImpl(char const* name = "AIStateMachineThreadBase::Thread") : mName(name) { }
public:
char const* getName(void) const { return mName; }
#endif
};
@@ -221,9 +218,11 @@ template<typename THREAD_IMPL>
struct AIStateMachineThread : public LLPointer<THREAD_IMPL>, public AIStateMachineThreadBase {
// Constructor.
AIStateMachineThread(void) :
LLPointer<THREAD_IMPL>(new THREAD_IMPL(this)),
LLPointer<THREAD_IMPL>(new THREAD_IMPL),
AIStateMachineThreadBase(LLPointer<THREAD_IMPL>::get())
{ }
{
*AIThreadImpl::StateMachineThread_wat(static_cast<AIThreadImpl*>(LLPointer<THREAD_IMPL>::get())->mStateMachineThread) = this;
}
};
#endif

View File

@@ -1270,10 +1270,6 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32
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,
bool upload_skin, bool upload_joints, bool do_upload,
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") ;
}
LLMeshUploadThread::~LLMeshUploadThread()
{
}
LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread)
{
mStage = "single_hull";

View File

@@ -394,10 +394,12 @@ public:
LLHost mHost;
std::string mWholeModelFeeCapability;
LLMeshUploadThread(AIStateMachineThreadBase* state_machine_thread);
~LLMeshUploadThread();
#ifdef LL_DEBUG
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,
LLHandle<LLWholeModelFeeObserver> const& fee_observer, LLHandle<LLWholeModelUploadObserver> const& upload_observer);
void postRequest(std::string& url, AIMeshUpload* state_machine);
/*virtual*/ bool run();