class MyMutex
{
volatile bool _lockBool = false;
public bool WaitOne()
{
while (_lockBool)
{
Thread.Sleep(0);
}
_lockBool = true;
return _lockBool;
}
public void ReleaseMutex()
{
if (_lockBool)
{
_lockBool = false;
}
return;
}
}