
490 9 Chapter 22: Living in a Shared Environment
ue (an int) that you can set. You can request that the lock be
granted if that condition has a certain value. By defining con-
stants with meaningful (to you) values, you can add a great
deal of sophistication to your locks.
You normally set the lock's condition value by using i ni t-
WithCondition or using unlockWithCondition. If the
condition value changes dynamically (between initialization
and unlocking), you can override the condition method.
Beware of getting too sophisticated with your conditions if
you are not experienced in this area. In particular, conditions
that themselves involve ...