Boost logo

Boost :

Subject: Re: [boost] Correct Mutext Destroy Behaviour, Pthreads and Boost
From: Bjorn Reese (breese_at_[hidden])
Date: 2015-06-01 17:10:07


On 06/01/2015 10:45 PM, Gottlob Frege wrote:
> On Mon, Jun 1, 2015 at 3:08 PM, Robert Bell <skyoyster_at_[hidden]> 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_destroy.html).
>>
>
> 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."


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk