From 693c98c5e2f9d674eb28952be3e105fba7ea06ad Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 20 Jan 2019 22:19:27 +0100 Subject: [PATCH] Cygwin: timerfd: Fix entering critical section Getting an abandonded mutex is just as well and must be handled. Signed-off-by: Corinna Vinschen --- winsup/cygwin/timerfd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/timerfd.h b/winsup/cygwin/timerfd.h index 6c42d91f4..711738283 100644 --- a/winsup/cygwin/timerfd.h +++ b/winsup/cygwin/timerfd.h @@ -59,7 +59,8 @@ class timerfd_shared /* write access methods */ bool enter_cs () { - return WaitForSingleObject (_access_mtx, INFINITE) == WAIT_OBJECT_0; + return (WaitForSingleObject (_access_mtx, INFINITE) & ~WAIT_ABANDONED_0) + == WAIT_OBJECT_0; } void leave_cs () {