diff options
| author | kprotty <kbutcher6200@gmail.com> | 2019-11-07 09:23:02 -0600 |
|---|---|---|
| committer | kprotty <kbutcher6200@gmail.com> | 2019-11-07 09:23:02 -0600 |
| commit | 92dac89d019fcd91aa043a116d6a6e166da8c4b2 (patch) | |
| tree | d9aacd696802d5d35d44ea1ab8a91a247e383bd6 /lib/std | |
| parent | 7045f1e875eba3ec9cd5bd051aee059d34776bed (diff) | |
| download | zig-92dac89d019fcd91aa043a116d6a6e166da8c4b2.tar.gz zig-92dac89d019fcd91aa043a116d6a6e166da8c4b2.zip | |
lock the mutex on pthread_cond_signal()
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/parker.zig | 2 |
1 files changed, 2 insertions, 0 deletions
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); } |
