Boost logo

Boost Users :

From: Paul Baxter (pauljbaxter_at_[hidden])
Date: 2006-04-18 21:08:30


Having looked at Boost threads and shmem 0.9 recently, I'm trying to get to
grips with a 'scoped lock' ONLY design rationale having laboured under the
posix threads APIs for a while.

While I appreciate the reasons, I am a little confused ...

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.

Is this possible?

e.g. a vector/array/deque of pointers to scoped_timer_locks each relating to
its own mutex and constructed as unlocked.

I understand that leaving mutexes locked is not a great idea! The
application does think it knows what it is doing.

Paul


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