|
Boost : |
From: Howard Hinnant (hinnant_at_[hidden])
Date: 2004-08-08 08:53:49
On Aug 8, 2004, at 6:00 AM, Bronek Kozicki wrote:
>> But when that happens, the generic lock(lock1,lock2) function no
>> longer works:
>
> I'm little scared about such lock function, where order of lock
> operations is disconnected from order of unlock operations. However
> this is something that possibly could be fixed - I'm thinking about
> building chains of locks.
I can't think of any reason for concern about unlock order. However
you're right that it can be fixed. Just make it an object
lock_both<Lock1, Lock2>, and record the order that you lock within the
lock_both so that you can use that information to unlock.
-Howard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk