25 Jul
2008
25 Jul
'08
3:43 p.m.
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.
If you use your mutex to protect the notify too, everything will be fine.
I think that if the mutex doesn't offer "POSIX destruction safety", the code can still fail. Thread A may be unblocked and destroy the mutex while thread B is still in mutex::unlock. http://lists.boost.org/Archives/boost/2004/07/68477.php