- attempt to fix irc thread crash foudn by tomreyn

This commit is contained in:
SoftCoder
2016-01-17 13:21:22 -08:00
parent df8b702149
commit 7eb6cff723

View File

@@ -304,14 +304,21 @@ int Thread::beginExecution(void* data) {
if(thread->threadObjectValid() == true) { if(thread->threadObjectValid() == true) {
safeMutex.Lock(); safeMutex.Lock();
thread->currentState = thrsExecuteAutoClean; thread->currentState = thrsExecuteAutoClean;
safeMutex.ReleaseLock(true); safeMutex.ReleaseLock();
thread->queueAutoCleanThread(); thread->queueAutoCleanThread();
} }
if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__); if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__);
safeMutex.Lock(); MutexSafeWrapper safeMutex2(thread->mutexthreadAccessor);
if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__);
if(thread->threadObjectValid() == true) {
if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__);
thread->currentState = thrsExecuteComplete; thread->currentState = thrsExecuteComplete;
safeMutex.ReleaseLock(); }
if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__);
safeMutex2.ReleaseLock();
if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__);
return 0; return 0;
} }