1 Aug
2003
1 Aug
'03
3:52 a.m.
Jason Winnebeck wrote:
The drawback is that you can't do
something like this with the RAII methods.
mtx.lock(); mtx2.lock(); mtx.release(); mtx2.release();
But I've never seen a case so far where I'm required to do that.
One use case for that that I'm aware of is when you want to have multiple concurrent searches/modifies in a tree datastructure. You can lock a parent node, scan the children nodes to find the one you want, lock the child and then release the parent so that another search can get to a sibling object before you are finished with the child node. -- Jonathan Biggar jon@floorboard.com jon@biggar.org