From 92dac89d019fcd91aa043a116d6a6e166da8c4b2 Mon Sep 17 00:00:00 2001 From: kprotty Date: Thu, 7 Nov 2019 09:23:02 -0600 Subject: [PATCH] lock the mutex on pthread_cond_signal() --- lib/std/parker.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/parker.zig b/lib/std/parker.zig index 2dc38d2b38..8df6dcaa92 100644 --- a/lib/std/parker.zig +++ b/lib/std/parker.zig @@ -199,6 +199,8 @@ const PosixParker = struct { } pub fn unpark(self: *PosixParker, ptr: *const u32) void { + assert(pthread_mutex_lock(&self.mutex) == 0); + defer assert(pthread_mutex_unlock(&self.mutex) == 0); assert(pthread_cond_signal(&self.cond) == 0); }