Fix a (harmless) race-condition.

ThreadLocalWaiter.unused may only be accessed from the owner thread.
This commit is contained in:
Sönke Ludwig 2019-04-13 17:01:50 +02:00
parent b7669868c0
commit a202d33b3e

View file

@ -1063,8 +1063,8 @@ struct ManualEvent {
auto drv = eventDriver; auto drv = eventDriver;
m_waiters.lock.active.iterate((ThreadWaiter w) { m_waiters.lock.active.iterate((ThreadWaiter w) {
() @trusted { logTrace("waiter %s", cast(void*)w); } (); () @trusted { logTrace("waiter %s", cast(void*)w); } ();
if (w.unused) return true;
if (w.m_driver is drv) { if (w.m_driver is drv) {
if (w.unused) return true;
lw = w; lw = w;
lw.addRef(); lw.addRef();
} else { } else {