summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-08-24 23:47:02 +0000
committerMike Frysinger <vapier@gentoo.org>2006-08-24 23:47:02 +0000
commitbb913f1c1c45860248cc8971bb54dfd29e29779f (patch)
treecd096be95222470dbbc2d61d77d2e0215b0344dd /libpthread
parentdf727decd95183c03ca17ed5b1bbc8e76f24dac2 (diff)
merge fixes from upstream (rev 1.10 -> 1.13)
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/linuxthreads.old/cancel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libpthread/linuxthreads.old/cancel.c b/libpthread/linuxthreads.old/cancel.c
index 1356348a7..f354c2a38 100644
--- a/libpthread/linuxthreads.old/cancel.c
+++ b/libpthread/linuxthreads.old/cancel.c
@@ -62,6 +62,7 @@ int pthread_cancel(pthread_t thread)
int dorestart = 0;
pthread_descr th;
pthread_extricate_if *pextricate;
+ int already_canceled;
__pthread_lock(&handle->h_lock, NULL);
if (invalid_handle(handle, thread)) {
@@ -71,13 +72,15 @@ int pthread_cancel(pthread_t thread)
th = handle->h_descr;
- if (th->p_canceled) {
+ already_canceled = th->p_canceled;
+ th->p_canceled = 1;
+
+ if (th->p_cancelstate == PTHREAD_CANCEL_DISABLE || already_canceled) {
__pthread_unlock(&handle->h_lock);
return 0;
}
pextricate = th->p_extricate;
- th->p_canceled = 1;
pid = th->p_pid;
/* If the thread has registered an extrication interface, then