[Project64] Add trace if deleting thread object in thread

This commit is contained in:
zilmar 2016-06-30 18:11:08 +10:00
parent c8cd2914a6
commit beada98cf5
1 changed files with 5 additions and 1 deletions

View File

@ -22,6 +22,10 @@ CThread::CThread(CTHREAD_START_ROUTINE lpStartAddress) :
CThread::~CThread() CThread::~CThread()
{ {
WriteTrace(TraceThread, TraceDebug, "Start"); WriteTrace(TraceThread, TraceDebug, "Start");
if (CThread::GetCurrentThreadId() == m_threadID)
{
WriteTrace(TraceThread, TraceError, "Deleting from thread!!!");
}
if (CThread::GetCurrentThreadId() != m_threadID && isRunning()) if (CThread::GetCurrentThreadId() != m_threadID && isRunning())
{ {
Terminate(); Terminate();
@ -119,7 +123,7 @@ void CThread::Terminate(void)
WriteTrace(TraceThread, TraceDebug, "Terminating thread"); WriteTrace(TraceThread, TraceDebug, "Terminating thread");
TerminateThread(m_thread, 0); TerminateThread(m_thread, 0);
#else #else
WriteTrace(TraceThread, TraceError, "Need to fix"); WriteTrace(TraceThread, TraceError, "Need to fix");
#endif #endif
} }
WriteTrace(TraceThread, TraceDebug, "Done"); WriteTrace(TraceThread, TraceDebug, "Done");