On Sun, 24 Oct 1999, Dan Sugalski wrote: > Just out of curiosity, why? I presume it's unlock in addition to locks > getting released when they fall out of scope. I can see the occasional > need, but I don't know that it'd be used enough to justify the extra > hassles involved. Yes, exactly: the occasional need. When you need to acquire two locks in a different order than you want to release them. For instance, if you want to walk along a tree structure, first locking the root to get the next branch, then unlocking the root so that others can walk as well. Simple things simple (lock with autounlock at end of block), complicated things possible (lock with unlock). Actually, I think that maybe $lock = lock $obj; undef $lock; would make a nice interface: then { my $lock = lock $obj } would do the same as C<lock> does by default but if you want, you can save the $lock variable somewhere. And no, I'm not advocating removing the current functionality. Only adding the ability to somehow get rid of locks earlier. TuomasThread Previous | Thread Next