- attempt to add crude thread state tracking in thread class and force thread to die if it appears to be stuck (and output to console)

This commit is contained in:
SoftCoder
2013-12-30 21:23:49 -08:00
parent e0aa65402d
commit b109b26664
2 changed files with 67 additions and 5 deletions

View File

@@ -46,6 +46,17 @@ namespace Shared { namespace Platform {
class Mutex;
//class uint32;
enum ThreadState {
thrsNew,
thrsStarting,
thrsExecuteStart,
thrsExecuting,
thrsExecuted,
thrsExecuteAutoClean,
thrsExecuteComplete
};
class Thread {
public:
enum Priority {
@@ -60,6 +71,7 @@ private:
SDL_Thread* thread;
//std::auto_ptr<Mutex> mutexthreadAccessor;
Mutex *mutexthreadAccessor;
ThreadState currentState;
bool threadObjectValid();
bool deleteAfterExecute;
@@ -71,6 +83,7 @@ protected:
void addThreadToList();
void removeThreadFromList();
void queueAutoCleanThread();
bool isThreadExecuteCompleteStatus();
public:
Thread();