| ||||
| Copyright 1999 Sams Publishing |
| | ||
| | |
| Chapter 17: The BooleanLock Utility |
| | |
| Overview |
| | |
| The BooleanLock class, which I present in this chapter, provides a useful encapsulation of a boolean variable that is easily and safely accessed from multiple threads. These threads can test and set the internal value and wait for it to change. The wait/notify mechanism is used internally to support waiting for the value to change, and frees external classes from the error-prone complexity of properly implementing this mechanism. |
| | | ||
| Toc | |||