FreeBSD Bugzilla – Attachment 169971 Details for
Bug 209233
[patch] pthread_suspend_all_np races with check_suspend
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Clear THR_FLAGS_SUSPENDED in resume_common() v2
1.patch (text/plain), 1.34 KB, created by
Konstantin Belousov
on 2016-05-04 17:16:40 UTC
(
hide
)
Description:
Clear THR_FLAGS_SUSPENDED in resume_common() v2
Filename:
MIME Type:
Creator:
Konstantin Belousov
Created:
2016-05-04 17:16:40 UTC
Size:
1.34 KB
patch
obsolete
>diff --git a/lib/libthr/thread/thr_resume_np.c b/lib/libthr/thread/thr_resume_np.c >index d11e328..b280cb1 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 ce7e70b..8241539 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--;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 209233
:
169926
|
169969
| 169971 |
169973