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

@ -546,7 +546,7 @@ private void writeDefault(OutputStream, InputStream)(ref OutputStream dst, Input
*/
struct DirectoryWatcher { // TODO: avoid all those heap allocations!
import std.array : Appender, appender;
import vibe.core.sync : ManualEvent;
import vibe.core.sync : LocalManualEvent;
@safe:
@ -554,7 +554,7 @@ struct DirectoryWatcher { // TODO: avoid all those heap allocations!
Path path;
bool recursive;
Appender!(DirectoryChange[]) changes;
ManualEvent changeEvent;
LocalManualEvent changeEvent;
}
private {