mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-22 01:37:59 +02:00
Thread priority fixes
This commit is contained in:
parent
b83c70e84b
commit
d998fe2229
2 changed files with 17 additions and 5 deletions
|
@ -11,7 +11,7 @@ namespace System.Threading
|
|||
public sealed class Thread
|
||||
{
|
||||
private int mInternalThread;
|
||||
private int32 mPriority;
|
||||
private ThreadPriority mPriority = .Normal;
|
||||
public int32 mMaxStackSize;
|
||||
private String mName ~ delete _;
|
||||
private Delegate mDelegate;
|
||||
|
@ -67,6 +67,8 @@ namespace System.Threading
|
|||
|
||||
if (thread.mName != null)
|
||||
thread.InformThreadNameChange(thread.mName);
|
||||
if (thread.mPriority != .Normal)
|
||||
thread.SetPriorityNative((.)thread.mPriority);
|
||||
|
||||
int32 stackStart = 0;
|
||||
thread.SetStackStart((void*)&stackStart);
|
||||
|
@ -219,8 +221,18 @@ namespace System.Threading
|
|||
|
||||
public ThreadPriority Priority
|
||||
{
|
||||
get { return (ThreadPriority)GetPriorityNative(); }
|
||||
set { SetPriorityNative((int32)value); }
|
||||
get
|
||||
{
|
||||
if (mInternalThread != 0)
|
||||
return (ThreadPriority)GetPriorityNative();
|
||||
return mPriority;
|
||||
}
|
||||
set
|
||||
{
|
||||
mPriority = value;
|
||||
if (mInternalThread != 0)
|
||||
SetPriorityNative((int32)value);
|
||||
}
|
||||
}
|
||||
[CallingConvention(.Cdecl)]
|
||||
private extern int32 GetPriorityNative();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue