1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-23 10:08:00 +02:00
Beef/BeefLibs/corlib/src/Threading/SpinWait.bf

27 lines
506 B
Beef
Raw Normal View History

2019-08-23 11:56:54 -07:00
namespace System.Threading
{
struct SpinWait
{
const int YIELD_THRESHOLD = 10; // When to switch over to a true yield.
const int SLEEP_0_EVERY_HOW_MANY_TIMES = 5; // After how many yields should we Sleep(0)?
const int SLEEP_1_EVERY_HOW_MANY_TIMES = 20; // After how many yields should we Sleep(1)?
2019-08-23 11:56:54 -07:00
private int m_count;
public int Count
{
get { return m_count; }
}
public void SpinOnce() mut
{
//TODO: Implement
}
public void Reset() mut
{
m_count = 0;
}
}
}