mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-22 17:48:01 +02:00
36 lines
671 B
Beef
36 lines
671 B
Beef
![]() |
namespace System.Threading
|
||
|
{
|
||
|
public class WaitEvent
|
||
|
{
|
||
|
Platform.BfpEvent* mEvent;
|
||
|
|
||
|
public this(bool initiallySet = false)
|
||
|
{
|
||
|
Platform.BfpEventFlags flags = .AllowAutoReset | .AllowManualReset;
|
||
|
if (initiallySet)
|
||
|
flags |= .InitiallySet_Manual;
|
||
|
mEvent = Platform.BfpEvent_Create(flags);
|
||
|
}
|
||
|
|
||
|
public ~this()
|
||
|
{
|
||
|
Platform.BfpEvent_Release(mEvent);
|
||
|
}
|
||
|
|
||
|
public void Set(bool requireManualReset = false)
|
||
|
{
|
||
|
Platform.BfpEvent_Set(mEvent, requireManualReset);
|
||
|
}
|
||
|
|
||
|
public void Reset()
|
||
|
{
|
||
|
Platform.BfpEvent_Reset(mEvent, null);
|
||
|
}
|
||
|
|
||
|
public bool WaitFor(int waitMS = -1)
|
||
|
{
|
||
|
return Platform.BfpEvent_WaitFor(mEvent, (int32)waitMS);
|
||
|
}
|
||
|
}
|
||
|
}
|