diff options
author | kib <kib@FreeBSD.org> | 2016-05-12 06:53:22 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-05-12 06:53:22 +0000 |
commit | 4f8ce4509a035d7c39c6f848b47b7bdc17ebe1ed (patch) | |
tree | 9bf664a17d03eeee6cd43545eec683306025bfc2 /lib/libthr/thread/thr_sig.c | |
parent | bd88c5334ca14635998cac65b7083ed3c1065c71 (diff) | |
download | FreeBSD-src-4f8ce4509a035d7c39c6f848b47b7bdc17ebe1ed.zip FreeBSD-src-4f8ce4509a035d7c39c6f848b47b7bdc17ebe1ed.tar.gz |
MFC r299114:
Do not leak THR_FLAGS_SUSPENDED from the previous suspend/resume
cycle.
PR: 209233
Diffstat (limited to 'lib/libthr/thread/thr_sig.c')
-rw-r--r-- | lib/libthr/thread/thr_sig.c | 4 |
1 files changed, 1 insertions, 3 deletions
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--; |