Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2008-05-11 05:58:00


"vicente.botet" <vicente.botet_at_[hidden]> writes:

> Hi,
>
> Consider the following situations:
>
> {
> unique_lock<mutex> lock(smtx);
>
> // ... some writing operations
>
> { // non locked block
> reverse_lock< unique_lock<mutex> > rlock(lock);
> // ... some code not needing the mutex to be locked
> } // locked again
>
> // ...
> }

> Do you think this usage is souhaitable or is this source of errors?

I've had to do it myself a few times. I think it's worthwhile adding it to the
library in order to ensure it is done as safely as possible.

Anthony

-- 
Anthony Williams            | Just Software Solutions Ltd
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

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