Fix ConcurrentSystemLocker to guard for a single writer at once
This commit is contained in:
@@ -22,6 +22,14 @@ RETRY:
|
||||
goto RETRY;
|
||||
}
|
||||
|
||||
// Writers have to check themselves to (one write at the same time - just like a mutex)
|
||||
if (write && Platform::AtomicRead(thisCounter) != 0)
|
||||
{
|
||||
// Someone else is doing opposite operation so wait for it's end
|
||||
Platform::Sleep(0);
|
||||
goto RETRY;
|
||||
}
|
||||
|
||||
// Mark that we entered this section
|
||||
Platform::InterlockedIncrement(thisCounter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user