diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2016-05-05 10:20:22 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2016-05-05 10:20:22 +0000 |
| commit | 321e2a0090f903eec06256b20deed0f5cf22d74a (patch) | |
| tree | 83a1eac216794bcb0bd207808d5ebafd25d55043 /lib/libthr/thread | |
| parent | 8a0fd1a7cd9d0345c027bea6212019ebf66af269 (diff) | |
Notes
Diffstat (limited to 'lib/libthr/thread')
| -rw-r--r-- | lib/libthr/thread/thr_resume_np.c | 2 | ||||
| -rw-r--r-- | lib/libthr/thread/thr_sig.c | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_resume_np.c b/lib/libthr/thread/thr_resume_np.c index d11e328fe2765..b280cb1122744 100644 --- a/lib/libthr/thread/thr_resume_np.c +++ b/lib/libthr/thread/thr_resume_np.c @@ -91,7 +91,7 @@ static void resume_common(struct pthread *thread) { /* Clear the suspend flag: */ - thread->flags &= ~THR_FLAGS_NEED_SUSPEND; + thread->flags &= ~(THR_FLAGS_NEED_SUSPEND | THR_FLAGS_SUSPENDED); thread->cycle++; _thr_umtx_wake(&thread->cycle, 1, 0); } diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index ce7e70beaa5ca..824153952d894 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -374,8 +374,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; @@ -392,7 +391,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--; |
