Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 24 May 2024 22:43:05 +0800
From: "AK47" <>
To: "musl" <>
Subject: Re:Re: Pthread robust_list for non-pshared mutexes


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"< &gt;;

Sent Time:2024/5/24 21:58

To:"musl"< &gt;;

Cc recipient:"AK47"< &gt;;

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


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.

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.