Re-implement ManualEvent.

This simplifies the logic by separating thread local notifications from cross-thread notifications, as well as replacing lockless operations by a spin lock. The thread local variant of ManualEvent is now also separated into a LocalManualEvent type.
This commit is contained in:
Sönke Ludwig 2017-01-13 22:24:18 +01:00
parent e28c6950d7
commit fdfbb55aa8
3 changed files with 438 additions and 318 deletions

View file

@ -1333,6 +1333,10 @@ static this()
synchronized (st_threadsMutex)
if (!st_threads.any!(c => c.thread is thisthr))
st_threads ~= ThreadContext(thisthr, false);
import vibe.core.sync : SpinLock;
SpinLock.setup();
}
static ~this()