org.cybergarage.util

## Class Mutex

- java.lang.Object
- - org.cybergarage.util.Mutex

-     public class Mutex
      extends Object

  A simple mutex implementation for thread synchronization. This class provides basic locking mechanisms using synchronized methods and wait/notify for inter-thread communication.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Mutex()` Creates a new Mutex instance in the unlocked state.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `lock()` Acquires the lock, blocking if necessary until the lock is available.
    `void` | `unlock()` Releases the lock and notifies all waiting threads.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Mutex

          public Mutex()

      Creates a new Mutex instance in the unlocked state.

  - ### Method Detail

    - #### lock

          public void lock()

      Acquires the lock, blocking if necessary until the lock is available. If the lock is already held, the calling thread will wait until it's released.

    - #### unlock

          public void unlock()

      Releases the lock and notifies all waiting threads. This method should only be called by the thread that currently holds the lock.