mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-21 09:27:59 +02:00
Moving corlib files out of "System" directory into root
This commit is contained in:
parent
4cd58262e4
commit
7dbfd15292
179 changed files with 3 additions and 0 deletions
26
BeefLibs/corlib/src/Threading/SpinWait.bf
Normal file
26
BeefLibs/corlib/src/Threading/SpinWait.bf
Normal file
|
@ -0,0 +1,26 @@
|
|||
namespace System.Threading
|
||||
{
|
||||
struct SpinWait
|
||||
{
|
||||
internal const int YIELD_THRESHOLD = 10; // When to switch over to a true yield.
|
||||
internal const int SLEEP_0_EVERY_HOW_MANY_TIMES = 5; // After how many yields should we Sleep(0)?
|
||||
internal const int SLEEP_1_EVERY_HOW_MANY_TIMES = 20; // After how many yields should we Sleep(1)?
|
||||
|
||||
private int m_count;
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return m_count; }
|
||||
}
|
||||
|
||||
public void SpinOnce() mut
|
||||
{
|
||||
//TODO: Implement
|
||||
}
|
||||
|
||||
public void Reset() mut
|
||||
{
|
||||
m_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue