On 06/01/2015 10:45 PM, Gottlob Frege wrote:
On Mon, Jun 1, 2015 at 3:08 PM, Robert Bell
wrote: If an object is implemented to support reference counting, and has an internal raw pthread mutex, the open group is pretty clear in the pthread_mutex_destroy doc on what different implementations must ensure (http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_destr...).
I think you are reading the spec wrong. See below.
Note the following statement at the bottom:
"A mutex can be destroyed immediately after it is unlocked. For example, consider the following code:"
Note the word "can" not "shall" or "must". Specs are very specific about the use of these words.
Further to the point, the quote comes from a non-normative section. The normative part only states that "Attempting to destroy a locked mutex or a mutex that is referenced [...] by another thread results in undefined behavior."