From nobody Wed Feb 8 00:27:13 2023 X-Original-To: dev-commits-src-branches@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 4PBLRP55LDz3p8lR; Wed, 8 Feb 2023 00:27:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBLRP4W0nz43c5; Wed, 8 Feb 2023 00:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675816033; 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=cXW9kFjgXIfL5shFJ+KHHu0ex7FqaH20T4qSEeuxqTI=; b=W5epflvXAzidQxp8XUnjvqnATPBMapNYRmlPWTdhe8iSPRLto81tw/NTHSqeXDMjt8nu5G 3751N8jkWValI7l0C1qxri6V2HszWy73k9YThHE2D2oMXl5ExUsRAc9UHpRM0r8HhUOo8X c6HkdYxj7ktDDrHtkslTuPs2g8o1A32cLo541QZZ23xOaJaHvAqpRYleMXaFeQJFxi2Jq7 frX9JsGr8p4S0R7YiyN+0YWtuGt+gOrOm0dIU5kiPvrbR0CE1JyQs9jMn9lVOnWwQWMDAl TDZ9f+Zm7hUm4DBXFvGNaNUM1PPuxqAFDeDXyRtjaN9hBy2p6tIli5sWZuN4mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675816033; 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=cXW9kFjgXIfL5shFJ+KHHu0ex7FqaH20T4qSEeuxqTI=; b=FdB1NKbW+iaLya36GRZ93L+s3FiscDUdFiPmuCg1cx7Sd6/MVOQdGK/DTZumlPeNZdfncJ wpqxSzqja7I4WNVsWgfjw3oOKOpji4pA86hjtI7mcZTUjhYQS4vvjiwN025jG8REVOEjJD SEwtkott8iYdaaUUX8fXkDlAMy/NxIjt/vF6Hi9UGE9cU9wN46nWubdHAoenGhtQ1HH5H8 m+ZmTavowIKNlyQhZrV/dtc6KGPZenKsl+/6Go3Wwl5mNWQ3a5C21WANN/DIVe2u+llbxN i8wMwXMiiQhFBn/n5cgoApYODIV2mf0wAhrpNnEPYdYt04RSItAbsS9hXNGP+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675816033; a=rsa-sha256; cv=none; b=OoN+cOsXvsgitkSbMz67WhxcPsg9y78FkWDtnO/Xd0bFb0TUstfsghAOMdWfpcf4shA3Kd eAQTjclkA4syWzpuv6soG2m+AiNxxmsbSsLpXupv3o8NnDQe2w0pD2DWpr9CPLNk9J2c6U P2i/z9biMzLX7TUUVrV8SeJbV/rRijJWih0Bt4d86tXcf2b7fV35ZyEoCTizRRRYWw3Som xDPs7OZK7hmbPe53t1xaKM15n+//WsUlZYK58GAufsHGHdtZcAmNFocuMGeqqY6Zf/qL0d VWrLHyGCYG/ujcawk4UP2FxTaIXM8sYlMY8hTCeuoNYiXRWjZh5RB0rDfjY41g== 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 4PBLRP3Z7pzcxY; Wed, 8 Feb 2023 00:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3180RDkH096551; Wed, 8 Feb 2023 00:27:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3180RDGs096550; Wed, 8 Feb 2023 00:27:13 GMT (envelope-from git) Date: Wed, 8 Feb 2023 00:27:13 GMT Message-Id: <202302080027.3180RDGs096550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 06e6efccbfab - stable/13 - libthr: add pshared_destroy() helper List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 06e6efccbfab46410ff7b9e034353453ea19ac3d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=06e6efccbfab46410ff7b9e034353453ea19ac3d commit 06e6efccbfab46410ff7b9e034353453ea19ac3d Author: Konstantin Belousov AuthorDate: 2023-02-01 21:06:04 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-08 00:26:59 +0000 libthr: add pshared_destroy() helper (cherry picked from commit 3cf37d1251bf71b2171e67af8f2ca43cbe3d874d) --- lib/libthr/thread/thr_pshared.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/libthr/thread/thr_pshared.c b/lib/libthr/thread/thr_pshared.c index d0219d0488f4..37b44ab73582 100644 --- a/lib/libthr/thread/thr_pshared.c +++ b/lib/libthr/thread/thr_pshared.c @@ -213,6 +213,17 @@ pshared_clean(void *key, void *val) _umtx_op(NULL, UMTX_OP_SHM, UMTX_SHM_DESTROY, key, NULL); } +static void +pshared_destroy(struct pthread *curthread, void *key) +{ + void *val; + + pshared_wlock(curthread); + val = pshared_remove(key); + pshared_unlock(curthread); + pshared_clean(key, val); +} + void * __thr_pshared_offpage(void *key, int doalloc) { @@ -248,13 +259,9 @@ void __thr_pshared_destroy(void *key) { struct pthread *curthread; - void *val; curthread = _get_curthread(); - pshared_wlock(curthread); - val = pshared_remove(key); - pshared_unlock(curthread); - pshared_clean(key, val); + pshared_destroy(curthread, key); pshared_gc(curthread); }