Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jan 2025 03:57:49 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 85671cefd93f - stable/14 - check_cancel: when in_sigsuspend, send SIGCANCEL unconditionally
Message-ID:  <202501040357.5043vnCk028426@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=85671cefd93fff9baf5245b6aae0b44d30621b94

commit 85671cefd93fff9baf5245b6aae0b44d30621b94
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-12-24 00:08:17 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-01-04 03:57:24 +0000

    check_cancel: when in_sigsuspend, send SIGCANCEL unconditionally
    
    PR:     283101
    
    (cherry picked from commit 9f78c837d94f73f1485e2ce012a8e64197dae9d5)
---
 lib/libthr/thread/thr_sig.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index a8268f2a770d..1e4a0b9a8f72 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -356,9 +356,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501040357.5043vnCk028426>