From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 050692290A for ; Fri, 9 Aug 2024 05:21:39 +0200 (CEST) Received: (qmail 18427 invoked by uid 550); 9 Aug 2024 03:21:33 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 18382 invoked from network); 9 Aug 2024 03:21:32 -0000 From: guolongqiang To: "musl@lists.openwall.com" CC: xufengwei Thread-Topic: questions about __tl_lock Thread-Index: AdrqCzPMmCaxyWfuQPyM7c/Mpdx8dA== Date: Fri, 9 Aug 2024 03:21:23 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.178.148] Content-Type: multipart/alternative; boundary="_000_f2bad7e008a1418dbcbba6fb8af2446chuaweicom_" MIME-Version: 1.0 Subject: [musl] questions about __tl_lock --_000_f2bad7e008a1418dbcbba6fb8af2446chuaweicom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, all I have one question about __tl_lock. The current implementation of= __tl_lock shown as follow. Obviously __thread_list_lock is a private memory, why don't we pass FUTEX_P= RIVATE option to __wait? ``` void __tl_lock(void) { int tid =3D __pthread_self()->tid; int val =3D __thread_list_lock; if (val =3D=3D tid) { tl_lock_count++; return; } while ((val =3D a_cas(&__thread_list_lock, 0, tid))) __wait(&__thread_list_lock, &tl_lock_waiters, val, 0); } ``` Thank you to explain. --_000_f2bad7e008a1418dbcbba6fb8af2446chuaweicom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi, all

     &= nbsp;   I have one question about __tl_lock. The current implemen= tation of __tl_lock shown as follow.

Ob= viously __thread_list_lock is a private memory, why don’t we pass FUT= EX_PRIVATE option to __wait?

 

```

void __tl_lock(void)=

{

in= t tid =3D __pthread_self()->tid;

in= t val =3D __thread_list_lock;

if= (val =3D=3D tid) {

tl_lock_count++;

return;

}<= o:p>

wh= ile ((val =3D a_cas(&__thread_list_lock, 0, tid)))

__wait(&__thread_list_lock, &tl_lock_waiters, val, 0);

}

```

Thank you to explain.

 

--_000_f2bad7e008a1418dbcbba6fb8af2446chuaweicom_--