summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_resume_np.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_resume_np.c')
-rw-r--r--lib/libthr/thread/thr_resume_np.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_resume_np.c b/lib/libthr/thread/thr_resume_np.c
index a3066bc..53377da 100644
--- a/lib/libthr/thread/thr_resume_np.c
+++ b/lib/libthr/thread/thr_resume_np.c
@@ -63,7 +63,11 @@ _pthread_resume_all_np(void)
{
struct pthread *curthread = _get_curthread();
struct pthread *thread;
+ int old_nocancel;
+ old_nocancel = curthread->no_cancel;
+ curthread->no_cancel = 1;
+ _thr_suspend_all_lock(curthread);
/* Take the thread list lock: */
THREAD_LIST_RDLOCK(curthread);
@@ -77,6 +81,9 @@ _pthread_resume_all_np(void)
/* Release the thread list lock: */
THREAD_LIST_UNLOCK(curthread);
+ _thr_suspend_all_unlock(curthread);
+ curthread->no_cancel = old_nocancel;
+ _thr_testcancel(curthread);
}
static void
OpenPOWER on IntegriCloud