Anthony Williams:

"Peter Dimov" <pdimov@pdimov.com> writes:

> Anthony Williams:
>
>> However, it is never safe to destroy any object whilst another thread
>> might still be in a member function.
>
> I believe that this is a "POSIX destruction safety" issue. POSIX CVs
> are supposed to support such code.

POSIX CVs are supposed to support broadcast immediately before
destroy. What we have here is the waiting thread doing the
destruction, which is not guaranteed safe by POSIX, as far as I know.


Looking at, e.g., http://www.opengroup.org/onlinepubs/009695399/functions/pthread_cond_init.html reveals that "It shall be safe to destroy an initialized condition variable upon which no threads are currently blocked." Am I right in understanding that the wait-destroy sequence should be quite safe this way (provided no one else waits)?

----
Vladimir