1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed GC race condition starting an autodelete thread

This commit is contained in:
Brian Fiete 2020-08-31 11:29:11 -07:00
parent 43660fb633
commit b3354ee635
5 changed files with 39 additions and 7 deletions

View file

@ -191,10 +191,10 @@ void Thread::StartInternal()
BfpSystem_InterlockedExchangeAdd32((uint32*)&gLiveThreadCount, 1);
BfInternalThread* internalThread = SetupInternalThread();
SetInternalThread(internalThread);
internalThread->mThread = this;
internalThread->mThreadHandle = BfpThread_Create(CStartProc, (void*)this, GetMaxStackSize(), BfpThreadCreateFlag_StackSizeReserve, &internalThread->mThreadId);
internalThread->mThread = this;
internalThread->mThreadHandle = BfpThread_Create(CStartProc, (void*)this, GetMaxStackSize(), (BfpThreadCreateFlags)(BfpThreadCreateFlag_StackSizeReserve | BfpThreadCreateFlag_Suspended), &internalThread->mThreadId);
SetInternalThread(internalThread);
BfpThread_Resume(internalThread->mThreadHandle, NULL);
}
int Thread::GetThreadId()