Top Description Fields Methods
com.jogamp.nativewindow

public Interface ToolkitLock

Known Direct Implementers
jogamp.nativewindow.GlobalToolkitLock, jogamp.nativewindow.NullToolkitLock, jogamp.nativewindow.ResourceToolkitLock, jogamp.nativewindow.SharedResourceToolkitLock
Imports
jogamp.nativewindow.Debug

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

Modifier and TypeField and Description
public static final boolean
public static final boolean

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Dispose this instance.

public void
lock()

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

public void
unlock()

Release the lock.

public void

Field Detail

DEBUGback to summary
public static final boolean DEBUG
TRACE_LOCKback to summary
public static final boolean TRACE_LOCK

Method Detail

disposeback to summary
public 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.
lockback to summary
public void lock()

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

Timeout is implementation specific, if used at all.

Exceptions
RuntimeException:
in case of a timeout
unlockback to summary
public void unlock()

Release the lock.

Exceptions
RuntimeException:
in case the lock is not acquired by this thread.
validateLockedback to summary
public void validateLocked() throws RuntimeException
Exceptions
RuntimeException:
if current thread does not hold the lock