From add205129cf16571a7deae9362723e40c389c06e Mon Sep 17 00:00:00 2001 From: davidxu Date: Fri, 24 Nov 2006 09:57:38 +0000 Subject: Eliminate atomic operations in thread cancellation functions, it should reduce overheads of cancellation points. --- lib/libthr/thread/thr_join.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/libthr/thread/thr_join.c') diff --git a/lib/libthr/thread/thr_join.c b/lib/libthr/thread/thr_join.c index de27074..92a3b62 100644 --- a/lib/libthr/thread/thr_join.c +++ b/lib/libthr/thread/thr_join.c @@ -76,7 +76,6 @@ join_common(pthread_t pthread, void **thread_return, struct timespec ts, ts2, *tsp; void *tmp; long tid; - int oldcancel; int ret = 0; if (pthread == NULL) @@ -104,7 +103,7 @@ join_common(pthread_t pthread, void **thread_return, THREAD_LIST_UNLOCK(curthread); THR_CLEANUP_PUSH(curthread, backout_join, pthread); - oldcancel = _thr_cancel_enter(curthread); + _thr_cancel_enter(curthread); tid = pthread->tid; while (pthread->tid != TID_TERMINATED) { @@ -123,7 +122,7 @@ join_common(pthread_t pthread, void **thread_return, break; } - _thr_cancel_leave(curthread, oldcancel); + _thr_cancel_leave(curthread); THR_CLEANUP_POP(curthread, 0); if (ret == ETIMEDOUT) { -- cgit v1.1