mailing list of musl libc
 help / color / mirror / code / Atom feed
From: AK47 <250200715@qq.com>
To: musl <musl@lists.openwall.com>
Subject: [musl] Re:Re: [musl] Pthread robust_list for non-pshared mutexes
Date: Fri, 24 May 2024 22:43:05 +0800	[thread overview]
Message-ID: <tencent_24E233C47719A30D8A6424D4C271E4351508@qq.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1624 bytes --]

Hi,



Sorry, maybe what I asked was a bit confusing. My question is, except robust and process-shared mutex, &nbsp;what is the purpose of putting the other kinds of mutexes into Robust_list such as the normal recursive mutex.&nbsp;


Take a normal recursive mutex as an example, if I lock and unlock it correctly in a thread, it will be put into robust list in pthread_mutex_lock and get removed from the list in pthread_mutex_unlock(). If I lock it but miss to unlock, it will be still in&nbsp;robust list and processed in&nbsp;pthread_exit().&nbsp;But in both cases, I did not find that the presence of the robust list had any impact on this mutex. Does it not need to be put into the robust list.




Best Regards

JinCheng Li







                       
Original Email
                       
                     

Sender:"Markus Wichmann"< nullplan@gmx.net &gt;;

Sent Time:2024/5/24 21:58

To:"musl"< musl@lists.openwall.com &gt;;

Cc recipient:"AK47"< 250200715@qq.com &gt;;

Subject:Re: [musl] Pthread robust_list for non-pshared mutexes


Hi,

not entirely sure what you mean. All non-normal mutexes get added to the
robust list, yes, but also get removed from the list in
pthread_mutex_unlock(). And the robust list is processed in
pthread_exit(), which all threads must call sooner or later. Only
exception is when a thread crashes, but in that case the entire process
dies, and non-pshared mutexes cease to matter.

If a thread is cancelled, __cancel() will call pthread_exit(). And I
know of no other way for a thread to "end" as you put it.

Ciao,
Markus

[-- Attachment #2: Type: text/html, Size: 14741 bytes --]

             reply	other threads:[~2024-05-24 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24 14:43 AK47 [this message]
2024-05-24 17:01 ` 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=tencent_24E233C47719A30D8A6424D4C271E4351508@qq.com \
    --to=250200715@qq.com \
    --cc=musl@lists.openwall.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).