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:
parent
43660fb633
commit
b3354ee635
5 changed files with 39 additions and 7 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue