From nobody Sat Dec 28 17:20:24 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YL8JT2C5Bz5jfKX; Sat, 28 Dec 2024 17:20:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YL8JT071gz4mSF; Sat, 28 Dec 2024 17:20:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735406425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uDK52fcvPdgE4h32XA/3JOCf6nRHkroxhXFpgdkznoI=; b=bzivFUAr5bsiEvTiuJ7Of+fSmmp6fw7639ia5lZ092+BglKejewn15Pf+DWnGMYeC3rBEK CrXUNOe5W5CU5Ncjq99nvH322af7dd7xm7M3yWUiSf0HleqnyNe4S2GPH7rIaytev6G0QX aRG3ev477F9E4PmLMmldqe5M65wwnrgJf684QVBGsanVmMk4kz2Nyqt4ytXVFYEtxJLzWl IM0SdYf7cnLU87SYuVhBbaMZl/sCTsc1m0Dt2c1lEbRceXN9wsFz8ZF4ubNzFilUFEX860 bXcKVp/Dx+pCt66RKid6vyLYRWFPtgEAJJ4hc7p9aULjN5vhN7WcibUjXil5eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735406425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uDK52fcvPdgE4h32XA/3JOCf6nRHkroxhXFpgdkznoI=; b=Ufm1p4s73ywXztZQ8NDh4lCn5V/yFmGTlzigTXFEsne+gUHHkmXYceAXnGx+tdLa6crnDG Nt/PcB1c48kwUwgQeTfdUzRf6kg7i8mDoMl74Po+3ogcj2x6PqYb7lSzOQjlQUihsAu3zM jwpNfDe23rBY6NsF0kTnRJBu8V0473QLHpZFKd7C1Q9mNTtwLKpxT/EUHJxdwGO93oPDB2 lfvSkamjgPxR7fMbLA/ouNx7pV3IQIi6FsW8FHCFpEEcqQqnoI0UFY9YfXjMmqru2WGuXD YwemtY5LCbBiDmMc8t7Ha7xGTTvfDVImDOda7WbF5heXVBG9beczKPHremoGzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735406425; a=rsa-sha256; cv=none; b=te11o64R8w+w8iZaTS/KxjnPpSZh0qnmriLnC6oaubSb53Xf9y4vXyV8OjGnIzfKg/xq4G zLW6pEl2IBFn2U9J0Q0BlRFBbVYE6zly3P+SmJtViJRz31Fj4ngeHp8SuS9YJtFEIx0Mzv BD/wBr2YxmF2xKIY+2oXM54ePdwvX8XGSH7pWYGp/gGvddNpoNDYfBTwLwqvcJgZxPxZ35 eTkq+iv9quBZrl4mioGkYpgZG850cKiEjU373uux65e103O39K5m+t9+U4A4nPYuSS0WKi XnAXnS4+iZ9lFy3NdhbKxVECsAbdLixtalam4vN5pqpZA/LMpibQJ2fZ8Mz50w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YL8JS6CnQzYdh; Sat, 28 Dec 2024 17:20:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BSHKO9f061997; Sat, 28 Dec 2024 17:20:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BSHKOeS061994; Sat, 28 Dec 2024 17:20:24 GMT (envelope-from git) Date: Sat, 28 Dec 2024 17:20:24 GMT Message-Id: <202412281720.4BSHKOeS061994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a944e6d5c0c2 - main - thr_cancel.c: use testcancel() instead of manually expanding it List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a944e6d5c0c27c2a533486062497a40d8f0ae543 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a944e6d5c0c27c2a533486062497a40d8f0ae543 commit a944e6d5c0c27c2a533486062497a40d8f0ae543 Author: Konstantin Belousov AuthorDate: 2024-12-21 17:55:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-12-28 17:01:44 +0000 thr_cancel.c: use testcancel() instead of manually expanding it Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48200 --- lib/libthr/thread/thr_cancel.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_cancel.c b/lib/libthr/thread/thr_cancel.c index 0e00c2c36086..7622e306f937 100644 --- a/lib/libthr/thread/thr_cancel.c +++ b/lib/libthr/thread/thr_cancel.c @@ -166,9 +166,8 @@ void _thr_cancel_leave(struct pthread *curthread, int maycancel) { curthread->cancel_point = 0; - if (__predict_false(SHOULD_CANCEL(curthread) && - !THR_IN_CRITICAL(curthread) && maycancel)) - _pthread_exit(PTHREAD_CANCELED); + if (maycancel) + testcancel(curthread); } void