mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-23 01:58:00 +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
35
BeefLibs/corlib/src/Threading/Event.bf
Normal file
35
BeefLibs/corlib/src/Threading/Event.bf
Normal file
|
@ -0,0 +1,35 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue