Boost logo

Boost :

From: bill_kempf (williamkempf_at_[hidden])
Date: 2002-03-13 17:41:38


--- In boost_at_y..., Carl Daniel <cpdaniel_at_p...> wrote:
> From: "bill_kempf" <williamkempf_at_h...>
> > ... This is no different
> > then what happens if there are threads trying to lock a mutex when
> > you destroy it, which is, rightfully I believe, defined as
undefined
> > behavior in both POSIX and Boost.Threads. On Windows platforms it
> > results in a return from WaitForSingleObject indicating
> > an "abandoned" mutex, but there's a lot of information you can
find
> > by doing a google search that shows why this is a bad idea.
> >
>
> Actually, that (WAIT_ABANDONED) is what happens if you kill the
thread that owns the mutex without releasing the mutex.
> If you destroy the mutex while threads are waiting on it, they'll
return WAIT_FAILED.
>
> Either way, it's a bad idea :)

Sorry, you're right. One of these days I'll learn to think through
before posting ;). But, as you point out, both error codes are
identical in usefullness. There's not much logic behind returning an
error here, as you can't really do anything useful at that point.

Bill Kempf


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