summaryrefslogtreecommitdiffstats
path: root/lib/libkse/thread/thr_mutex.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>1999-12-17 00:57:54 +0000
committerdeischen <deischen@FreeBSD.org>1999-12-17 00:57:54 +0000
commit8456ca731197cd424e1d5a70363f568d2424d38b (patch)
tree6af52cbde8a6b3b4543c13ca8f8c2a579020ecd5 /lib/libkse/thread/thr_mutex.c
parent17ee572a14054fb3c892f9dc5ee491e75bc8f3f5 (diff)
downloadFreeBSD-src-8456ca731197cd424e1d5a70363f568d2424d38b.zip
FreeBSD-src-8456ca731197cd424e1d5a70363f568d2424d38b.tar.gz
Fix problems with cancellation while in critical regions.
o Cancellation flags were not getting properly set/cleared. o Loops waiting for internal locks were not being exited correctly by a cancelled thread. o Minor spelling (cancelation -> cancellation) and formatting corrections (missing tab). Found by: tg Reviewed by: jasone
Diffstat (limited to 'lib/libkse/thread/thr_mutex.c')
-rw-r--r--lib/libkse/thread/thr_mutex.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c
index b2a06f2..c625ef2 100644
--- a/lib/libkse/thread/thr_mutex.c
+++ b/lib/libkse/thread/thr_mutex.c
@@ -623,6 +623,7 @@ pthread_mutex_lock(pthread_mutex_t * mutex)
_thread_kern_sig_undefer();
if ((_thread_run->cancelflags & PTHREAD_CANCEL_NEEDED) != 0) {
+ _thread_run->cancelflags &= ~PTHREAD_CANCEL_NEEDED;
_thread_exit_cleanup();
pthread_exit(PTHREAD_CANCELED);
}
OpenPOWER on IntegriCloud