mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] questions about __tl_lock
@ 2024-08-09  3:21 guolongqiang
  2024-08-10  2:51 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: guolongqiang @ 2024-08-09  3:21 UTC (permalink / raw)
  To: musl; +Cc: xufengwei

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-10  4:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-09  3:21 [musl] questions about __tl_lock guolongqiang
2024-08-10  2:51 ` Rich Felker
2024-08-10  3:28   ` 答复: " guolongqiang
2024-08-10  4:04     ` [musl] " Rich Felker

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).