Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-07-18 14:01:51

Russell Hind wrote:
> Jon Biggar wrote:
>> The assert in the smart_ptr case is a different, since asserting
>> rather than dereferencing a null pointer is merely moving the
>> inevitable
>> SEGV/core dump up a bit to a place where it's probably a bit easier
>> to debug.
> Ok, but what happens if locking an already locked mutex where
> undefined behaviour? This isn't this the same as the smart_ptr case?
> Who knows how the actual implementation is on all the platforms, or future
> platforms?

Locking an already locked boost::mutex is undefined behavior. But attempting
to Lock::lock() twice is defined to throw lock_error since it is easily
detectable, regardless of platform.

Boost list run by bdawes at, gregod at, cpdaniel at, john at