|
Threads-Devel : |
From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2007-07-23 21:20:25
On Monday 23 July 2007 10:26, Kai Brüning wrote:
> Hi,
>
> I have been using a two-layer wrapper for boost mutex recently. One
> layer to create levelled mutexes as described by Anthony, and another
> one to track the locked/unlocked state together with the owning thread
> for debug purposes.
Yes, my imagined debug mutex would also keep track of the owning thread,
because the other component I want is a way to make sure a given piece of
data (or more generally an object) is always protected by a mutex when
accessed. My idea here is fuzzier, I'm thinking something like a
shared_ptr whose get() function checks to make sure there exists a mutex
which is already locked by the current thread, and was also locked on
every previous get() call.
> I am contemplating making this a boost library and would be very happy
> to work on something together with you. What do you think about a
> general mutex wrapping framework allowing multiple wrappers plus a
> collection of useful wrappers such as those described here?
I'd be happy to contribute any code I write to a larger project, that would
be ideal. I don't have the time resources to contribute much beyond
maintaining my pieces of the code though.
-- Frank