From e3c680b0ce3a118bd49c05a7acccfebad01dbbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 27 Mar 2017 16:32:24 +0200 Subject: [PATCH] Add assertion to ManualEvent to check for failure of creating event handles. --- source/vibe/core/sync.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/vibe/core/sync.d b/source/vibe/core/sync.d index 78a356b..4b76bbd 100644 --- a/source/vibe/core/sync.d +++ b/source/vibe/core/sync.d @@ -923,8 +923,10 @@ struct ManualEvent { () @trusted { logTrace("wait shared %s", cast(void*)&this); } (); - if (ms_threadEvent is EventID.invalid) + if (ms_threadEvent is EventID.invalid) { ms_threadEvent = eventDriver.events.create(); + assert(ms_threadEvent != EventID.invalid, "Failed to create event!"); + } SysTime target_timeout, now; if (timeout != Duration.max) {