FreeBSD Bugzilla – Attachment 256100 Details for
Bug 283101
pthread_cancel() doesn't cancel a thread that's currently in pause()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Supposed fix
1.patch (text/plain), 1.21 KB, created by
Konstantin Belousov
on 2024-12-24 14:35:05 UTC
(
hide
)
Description:
Supposed fix
Filename:
MIME Type:
Creator:
Konstantin Belousov
Created:
2024-12-24 14:35:05 UTC
Size:
1.21 KB
patch
obsolete
>commit 873a15ed81d95f3012cd8a8a946edc077d5e5a46 >Author: Konstantin Belousov <kib@FreeBSD.org> >Date: Tue Dec 24 02:08:17 2024 +0200 > > check_cancel: when in_sigsuspend, send SIGCANCEL unconditionally > > not only when check_cancel is called from the signal handler. > _thr_wake() is not enough to get the sigsuspend(2) syscall out of the > loop, since it only terminates sleep when an unblocked signal is > delivered. > > PR: 283101 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > >diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c >index c136d9072af1..d88a96c62676 100644 >--- a/lib/libthr/thread/thr_sig.c >+++ b/lib/libthr/thread/thr_sig.c >@@ -354,9 +354,11 @@ check_cancel(struct pthread *curthread, ucontext_t *ucp) > * on getting a signal before it agrees to return. > */ > if (curthread->cancel_point) { >- if (curthread->in_sigsuspend && ucp != NULL) { >- SIGADDSET(ucp->uc_sigmask, SIGCANCEL); >- curthread->unblock_sigcancel = 1; >+ if (curthread->in_sigsuspend) { >+ if (ucp != NULL) { >+ SIGADDSET(ucp->uc_sigmask, SIGCANCEL); >+ curthread->unblock_sigcancel = 1; >+ } > _thr_send_sig(curthread, SIGCANCEL); > } else > thr_wake(curthread->tid);
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 283101
:
255901
|
255902
|
255955
| 256100