diff options
Diffstat (limited to 'src/thread/pthread_cond_signal.c')
-rw-r--r-- | src/thread/pthread_cond_signal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/thread/pthread_cond_signal.c b/src/thread/pthread_cond_signal.c index b26b8ce5..71bcdcd9 100644 --- a/src/thread/pthread_cond_signal.c +++ b/src/thread/pthread_cond_signal.c @@ -2,7 +2,8 @@ int pthread_cond_signal(pthread_cond_t *c) { - a_store(&c->_c_block, 0); - if (c->_c_waiters) __wake(&c->_c_block, 1, 0); + if (!c->_c_waiters) return 0; + a_inc(&c->_c_seq); + if (c->_c_waiters) __wake(&c->_c_seq, 1, 0); return 0; } |