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

Change JoinOnDelete method

This commit is contained in:
Brian Fiete 2024-03-02 17:09:10 -05:00
parent f61cb91255
commit 897b1f6fc4

View file

@ -20,6 +20,7 @@ namespace System.Threading
private Object mThreadStartArg;
bool mAutoDelete;
bool mJoinOnDelete;
static Monitor sMonitor = new .() ~ delete _;
static Event<delegate void()> sOnExit ~ _.Dispose();
@ -393,6 +394,9 @@ namespace System.Threading
sOnExit();
}
if (mJoinOnDelete)
Join();
// Make sure we're not deleting manually if mAutoDelete is set
Debug.Assert((!mAutoDelete) || (CurrentThread == this));
// Delegate to the unmanaged portion.
@ -413,8 +417,11 @@ namespace System.Threading
private extern bool IsBackgroundNative();
[CallingConvention(.Cdecl)]
private extern void SetBackgroundNative(bool isBackground);
[CallingConvention(.Cdecl)]
public extern void SetJoinOnDelete(bool joinOnDelete);
public void SetJoinOnDelete(bool joinOnDelete)
{
mJoinOnDelete = joinOnDelete;
}
public ThreadState ThreadState
{