From a202d33b3e4d0aab3ca007baa800809973b31c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sat, 13 Apr 2019 17:01:50 +0200 Subject: [PATCH] Fix a (harmless) race-condition. ThreadLocalWaiter.unused may only be accessed from the owner thread. --- source/vibe/core/sync.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/vibe/core/sync.d b/source/vibe/core/sync.d index dffc335..11afc0d 100644 --- a/source/vibe/core/sync.d +++ b/source/vibe/core/sync.d @@ -1063,8 +1063,8 @@ struct ManualEvent { auto drv = eventDriver; m_waiters.lock.active.iterate((ThreadWaiter w) { () @trusted { logTrace("waiter %s", cast(void*)w); } (); - if (w.unused) return true; if (w.m_driver is drv) { + if (w.unused) return true; lw = w; lw.addRef(); } else {