
19 Apr
2006
19 Apr
'06
1:23 a.m.
On 4/18/06, Paul Baxter
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