From 788973f628617098c27f0e8babd4b3cf6cebd0c4 Mon Sep 17 00:00:00 2001 From: Boris-Barboris Date: Fri, 30 Mar 2018 12:59:24 +0000 Subject: [PATCH] same measures for ManualEvent --- source/vibe/core/sync.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/vibe/core/sync.d b/source/vibe/core/sync.d index 8d9868d..f84a455 100644 --- a/source/vibe/core/sync.d +++ b/source/vibe/core/sync.d @@ -1027,8 +1027,8 @@ struct ManualEvent { int ec = this.emitCount; acquireThreadWaiter((scope ThreadWaiter w) { - while (ec <= emit_count) { - w.wait!interruptible(timeout != Duration.max ? target_timeout - now : Duration.max, ms_threadEvent, () => this.emitCount > emit_count); + while (ec - emit_count <= 0) { + w.wait!interruptible(timeout != Duration.max ? target_timeout - now : Duration.max, ms_threadEvent, () => (this.emitCount - emit_count) > 0); ec = this.emitCount; if (timeout != Duration.max) {