From f286813e7b1f55beb0e2f315e33c2efd3099874d Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Sun, 17 Jan 2016 14:14:05 -0800 Subject: [PATCH] - added more verbose info for thread crash issue --- source/shared_lib/sources/platform/sdl/thread.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/shared_lib/sources/platform/sdl/thread.cpp b/source/shared_lib/sources/platform/sdl/thread.cpp index d841ac013..ee422ce74 100644 --- a/source/shared_lib/sources/platform/sdl/thread.cpp +++ b/source/shared_lib/sources/platform/sdl/thread.cpp @@ -242,14 +242,24 @@ std::vector Thread::getThreadList() { } void Thread::start() { + if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__); + MutexSafeWrapper safeMutex(mutexthreadAccessor); currentState = thrsStarting; BaseThread *base_thread = dynamic_cast(this); if(base_thread) base_thread->setStarted(true); string uniqueId = (base_thread ? base_thread->getUniqueID() : "new_base_thread_prev_null"); + + if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__); + thread = SDL_CreateThread(beginExecution, uniqueId.c_str(), this); + + if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__); + if(thread == NULL) { + if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__); + if(base_thread) base_thread->setStarted(false); char szBuf[8096]=""; @@ -257,6 +267,7 @@ void Thread::start() { throw megaglest_runtime_error(szBuf); } + if(Thread::getEnableVerboseMode()) printf("In Thread::execute Line: %d\n",__LINE__); //printf("In Thread::start Line: %d [%p] thread = %p\n",__LINE__,this,thread); }