From: guolongqiang <guolongqiang@huawei.com>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Cc: xufengwei <xufengwei@huawei.com>
Subject: [musl] questions about __tl_lock
Date: Fri, 9 Aug 2024 03:21:23 +0000 [thread overview]
Message-ID: <f2bad7e008a1418dbcbba6fb8af2446c@huawei.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 501 bytes --]
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_PRIVATE option to __wait?
```
void __tl_lock(void)
{
int tid = __pthread_self()->tid;
int val = __thread_list_lock;
if (val == tid) {
tl_lock_count++;
return;
}
while ((val = a_cas(&__thread_list_lock, 0, tid)))
__wait(&__thread_list_lock, &tl_lock_waiters, val, 0);
}
```
Thank you to explain.
[-- Attachment #2: Type: text/html, Size: 3993 bytes --]
next reply other threads:[~2024-08-09 3:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 3:21 guolongqiang [this message]
2024-08-10 2:51 ` Rich Felker
2024-08-10 3:28 ` 答复: " guolongqiang
2024-08-10 4:04 ` [musl] " Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f2bad7e008a1418dbcbba6fb8af2446c@huawei.com \
--to=guolongqiang@huawei.com \
--cc=musl@lists.openwall.com \
--cc=xufengwei@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).