bugfix for shutdown of threads and garbage collection.

This commit is contained in:
Mark Vejvoda
2013-06-22 03:36:18 +00:00
parent 76ee030e93
commit bb14d4cc1e
5 changed files with 102 additions and 40 deletions

View File

@@ -52,11 +52,15 @@ protected:
bool hasBeginExecution;
bool deleteSelfOnExecutionDone;
Mutex mutexStarted;
bool started;
virtual void setQuitStatus(bool value);
void deleteSelfIfRequired();
void *genericData;
public:
BaseThread();
virtual ~BaseThread();
@@ -66,6 +70,9 @@ public:
virtual bool getQuitStatus();
virtual bool getRunningStatus();
virtual bool getStarted();
virtual void setStarted(bool value);
virtual bool getHasBeginExecution();
virtual void setHasBeginExecution(bool value);

View File

@@ -58,6 +58,9 @@ public:
private:
SDL_Thread* thread;
std::auto_ptr<Mutex> mutexthreadAccessor;
bool threadObjectValid();
bool deleteAfterExecute;
static Mutex mutexthreadList;
static vector<Thread *> threadList;