commit 92dac89d019fcd91aa043a116d6a6e166da8c4b2 (tree)
parent 7045f1e875eba3ec9cd5bd051aee059d34776bed
Author: kprotty <kbutcher6200@gmail.com>
Date: Thu, 7 Nov 2019 09:23:02 -0600
lock the mutex on pthread_cond_signal()
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git 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);
}