Boost logo

Boost Users :

From: me22 (me22.ca_at_[hidden])
Date: 2006-04-18 21:23:51


On 4/18/06, Paul Baxter <pauljbaxter_at_[hidden]> wrote:
> All the examples I've seen show scoped locks being constructed local to a
> function and then destroyed automatically at the end of function scope.
>
> I would like my own lock manager object to manage a group of locks and allow
> me to leave one or more mutexes locked across function calls until the lock
> manager object goes out of scope and releases any mutexes still flagged as
> locked.
>
As usual when you want fancy scope control, you can use a pointer.
One of the smart pointers to the lock would work nicely.

IIRC you can also explicitly *un*lock scoped locks, so you might be
able to have your manager lock them all on construction then unlock as
nessesary.

~ SWMc


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