Boost logo

Boost Users :

From: Vladimir Pozdyaev (vpozdyaev_at_[hidden])
Date: 2008-07-28 06:49:04


 Anthony Williams:

>
> "Peter Dimov" <pdimov_at_[hidden]> 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.htmlreveals
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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net