javax.media.nativewindow

## Interface ToolkitLock

-     public interface ToolkitLock

  Marker for a singleton global recursive blocking lock implementation, optionally locking a native windowing toolkit as well.

  Toolkit locks are created solely via `NativeWindowFactory`.

  One use case is the AWT locking on X11, see `NativeWindowFactory.getDefaultToolkitLock(String, long)`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEBUG`
    `static boolean` | `TRACE_LOCK`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispose()` Dispose this instance.
    `void` | `lock()` Blocking until the lock is acquired by this Thread or a timeout is reached.
    `void` | `unlock()` Release the lock.
    `void` | `validateLocked()`

- - ### Field Detail

    - #### DEBUG

          static final boolean DEBUG

    - #### TRACE_LOCK

          static final boolean TRACE_LOCK

  - ### Method Detail

    - #### lock

          void lock()

      Blocking until the lock is acquired by this Thread or a timeout is reached.

      Timeout is implementation specific, if used at all.

      Throws:
        `RuntimeException` - in case of a timeout

    - #### unlock

          void unlock()

      Release the lock.
      Throws:
        `RuntimeException` - in case the lock is not acquired by this thread.

    - #### validateLocked

          void validateLocked()
                              throws RuntimeException

      Throws:
        `RuntimeException` - if current thread does not hold the lock

    - #### dispose

          void dispose()

      Dispose this instance.

      Shall be called when instance is no more required.

      This allows implementations sharing a lock via resources to decrease the reference counter.

Copyright 2010 JogAmp Community.