Locks and Condition Variables

The package "util" provides lock and condition variable classes.
  1. Lock - has methods get( ) and put( ) to obtain and release an exclusive lock.

  2. ReadWriteLock - has methods getReader( ), putReader( ), getWriter( ), and putWriter( ) to manage a shared-read, exclusive-write lock.

  3. Condition - an abstract class, with methods get( ), put( ), and clear( ). Typical code waits on a condition by calling get( ); somebody else calls put( ) to grant access to a resource, or clear( ) to prevent any further calls to get( ) from succeeding.

  4. SharedCondition - after a put( ), lets all get( ) calls succeed until a call to clear( ). A SharedCondition typically indicates that a read-only resource has become available.

  5. ExclusiveCondition - after a put( ), a single caller of get( ) will continue execution.

  6. DelayedCondition - a failed attempt to simplify the code for the DVI Controls window.