Boost logo

Boost Users :

Subject: Re: [Boost-users] owns_lock on lock not on mutex
From: gast128 (gast128_at_[hidden])
Date: 2015-10-12 13:04:24


Agustín K-ballo Bergé <kaballo86 <at> hotmail.com> writes:

>
> On 10/12/2015 6:03 AM, gast128 wrote:
> > there is an owns_lock on the lock type but not on the mutex. This is quite
> > unhandy. Any reason why?
>
> A mutex could never own a lock on itself. The owner of a lock is the one
> responsible for calling unlock on it.
>
> Regards,

Ok I should have expressed myself better: there seems to be no function to
query a mutex if it is locked (e.g. no 'is_locked'). Use case is that I have
private functions, which must assert that a non recursive mutex is locked.
The locking is already done in the public part. Why is there no such
function? Is there a technical reason or just overlooked?


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