From 4f8ce4509a035d7c39c6f848b47b7bdc17ebe1ed Mon Sep 17 00:00:00 2001 From: kib Date: Thu, 12 May 2016 06:53:22 +0000 Subject: MFC r299114: Do not leak THR_FLAGS_SUSPENDED from the previous suspend/resume cycle. PR: 209233 --- lib/libthr/thread/thr_sig.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/libthr/thread/thr_sig.c') diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index ebb6c58..dc51f34 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -373,8 +373,7 @@ check_suspend(struct pthread *curthread) */ curthread->critical_count++; THR_UMUTEX_LOCK(curthread, &(curthread)->lock); - while ((curthread->flags & (THR_FLAGS_NEED_SUSPEND | - THR_FLAGS_SUSPENDED)) == THR_FLAGS_NEED_SUSPEND) { + while ((curthread->flags & THR_FLAGS_NEED_SUSPEND) != 0) { curthread->cycle++; cycle = curthread->cycle; @@ -391,7 +390,6 @@ check_suspend(struct pthread *curthread) THR_UMUTEX_UNLOCK(curthread, &(curthread)->lock); _thr_umtx_wait_uint(&curthread->cycle, cycle, NULL, 0); THR_UMUTEX_LOCK(curthread, &(curthread)->lock); - curthread->flags &= ~THR_FLAGS_SUSPENDED; } THR_UMUTEX_UNLOCK(curthread, &(curthread)->lock); curthread->critical_count--; -- cgit v1.1