mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Change JoinOnDelete method
This commit is contained in:
parent
f61cb91255
commit
897b1f6fc4
1 changed files with 9 additions and 2 deletions
|
@ -20,6 +20,7 @@ namespace System.Threading
|
||||||
private Object mThreadStartArg;
|
private Object mThreadStartArg;
|
||||||
|
|
||||||
bool mAutoDelete;
|
bool mAutoDelete;
|
||||||
|
bool mJoinOnDelete;
|
||||||
|
|
||||||
static Monitor sMonitor = new .() ~ delete _;
|
static Monitor sMonitor = new .() ~ delete _;
|
||||||
static Event<delegate void()> sOnExit ~ _.Dispose();
|
static Event<delegate void()> sOnExit ~ _.Dispose();
|
||||||
|
@ -393,6 +394,9 @@ namespace System.Threading
|
||||||
sOnExit();
|
sOnExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mJoinOnDelete)
|
||||||
|
Join();
|
||||||
|
|
||||||
// Make sure we're not deleting manually if mAutoDelete is set
|
// Make sure we're not deleting manually if mAutoDelete is set
|
||||||
Debug.Assert((!mAutoDelete) || (CurrentThread == this));
|
Debug.Assert((!mAutoDelete) || (CurrentThread == this));
|
||||||
// Delegate to the unmanaged portion.
|
// Delegate to the unmanaged portion.
|
||||||
|
@ -413,8 +417,11 @@ namespace System.Threading
|
||||||
private extern bool IsBackgroundNative();
|
private extern bool IsBackgroundNative();
|
||||||
[CallingConvention(.Cdecl)]
|
[CallingConvention(.Cdecl)]
|
||||||
private extern void SetBackgroundNative(bool isBackground);
|
private extern void SetBackgroundNative(bool isBackground);
|
||||||
[CallingConvention(.Cdecl)]
|
|
||||||
public extern void SetJoinOnDelete(bool joinOnDelete);
|
public void SetJoinOnDelete(bool joinOnDelete)
|
||||||
|
{
|
||||||
|
mJoinOnDelete = joinOnDelete;
|
||||||
|
}
|
||||||
|
|
||||||
public ThreadState ThreadState
|
public ThreadState ThreadState
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue