projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
559de8f
)
fix regression in pthread_cond_wait with cancellation disabled
author
Rich Felker
<dalias@aerifal.cx>
Sat, 7 Mar 2015 19:11:01 +0000
(14:11 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 7 Mar 2015 19:11:01 +0000
(14:11 -0500)
due to a logic error in the use of masked cancellation mode,
pthread_cond_wait did not honor PTHREAD_CANCEL_DISABLE but instead
failed with ECANCELED when cancellation was pending.
src/thread/pthread_cond_timedwait.c
patch
|
blob
|
history
diff --git
a/src/thread/pthread_cond_timedwait.c
b/src/thread/pthread_cond_timedwait.c
index 27b1a99ae7f706d5f2dab416895b79c604ec2910..3526ecfb6d2eee92817dd00da769fe9dc3bdb4f4 100644
(file)
--- a/
src/thread/pthread_cond_timedwait.c
+++ b/
src/thread/pthread_cond_timedwait.c
@@
-100,6
+100,7
@@
int __pthread_cond_timedwait(pthread_cond_t *restrict c, pthread_mutex_t *restri
__pthread_mutex_unlock(m);
__pthread_setcancelstate(PTHREAD_CANCEL_MASKED, &cs);
+ if (cs == PTHREAD_CANCEL_DISABLE) __pthread_setcancelstate(cs, 0);
do e = __timedwait_cp(fut, seq, clock, ts, !shared);
while (*fut==seq && (!e || e==EINTR));