projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add missing ptrace requests and options to sys/ptrace.h
[musl]
/
src
/
thread
/
pthread_cond_timedwait.c
diff --git
a/src/thread/pthread_cond_timedwait.c
b/src/thread/pthread_cond_timedwait.c
index
56e71c2
..
1f25c8e
100644
(file)
--- a/
src/thread/pthread_cond_timedwait.c
+++ b/
src/thread/pthread_cond_timedwait.c
@@
-12,6
+12,7
@@
static void unwait(pthread_cond_t *c, pthread_mutex_t *m)
if (c->_c_mutex == (void *)-1) {
a_dec(&c->_c_waiters);
if (c->_c_mutex == (void *)-1) {
a_dec(&c->_c_waiters);
+ if (c->_c_destroy) __wake(&c->_c_waiters, 1, 0);
return;
}
return;
}
@@
-23,6
+24,9
@@
static void unwait(pthread_cond_t *c, pthread_mutex_t *m)
a_store(&c->_c_lock, 0);
if (c->_c_lockwait) __wake(&c->_c_lock, 1, 1);
a_store(&c->_c_lock, 0);
if (c->_c_lockwait) __wake(&c->_c_lock, 1, 1);
+
+ a_dec(&c->_c_waiters);
+ if (c->_c_destroy) __wake(&c->_c_waiters, 1, 1);
}
static void cleanup(void *p)
}
static void cleanup(void *p)
@@
-32,7
+36,7
@@
static void cleanup(void *p)
pthread_mutex_lock(cm->m);
}
pthread_mutex_lock(cm->m);
}
-int pthread_cond_timedwait(pthread_cond_t *
c, pthread_mutex_t *m, const struct timespec *
ts)
+int pthread_cond_timedwait(pthread_cond_t *
restrict c, pthread_mutex_t *restrict m, const struct timespec *restrict
ts)
{
struct cm cm = { .c=c, .m=m };
int r, e=0, seq;
{
struct cm cm = { .c=c, .m=m };
int r, e=0, seq;