GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.locks.SingletonInstance Class Referenceabstract
Inheritance diagram for com.jogamp.common.util.locks.SingletonInstance:
Collaboration diagram for com.jogamp.common.util.locks.SingletonInstance:

Public Member Functions

final long getPollPeriod ()
 
abstract String getName ()
 
final String toString ()
 
synchronized void lock () throws RuntimeException
 Blocking until the lock is acquired by this Thread or TIMEOUT is reached. More...
 
synchronized boolean tryLock (long maxwait) throws RuntimeException
 Blocking until the lock is acquired by this Thread or maxwait in ms is reached. More...
 
void unlock () throws RuntimeException
 Release the lock. More...
 
synchronized boolean isLocked ()
 Query if locked. More...
 
void lock () throws RuntimeException
 Blocking until the lock is acquired by this Thread or TIMEOUT is reached. More...
 
boolean tryLock (long timeout) throws InterruptedException
 Blocking until the lock is acquired by this Thread or maxwait in ms is reached. More...
 
void unlock () throws RuntimeException
 Release the lock. More...
 
boolean isLocked ()
 Query if locked. More...
 

Static Public Member Functions

static SingletonInstance createFileLock (final long poll_ms, final String lockFileBasename)
 
static SingletonInstance createFileLock (final long poll_ms, final File lockFile)
 
static SingletonInstance createServerSocket (final long poll_ms, final int portNumber)
 A user shall use ephemeral ports: More...
 

Protected Member Functions

 SingletonInstance (final long poll_ms)
 
abstract boolean tryLockImpl ()
 
abstract boolean unlockImpl ()
 
String infoPrefix (final long currentMillis)
 
String infoPrefix ()
 

Static Protected Attributes

static final boolean DEBUG = true
 

Additional Inherited Members

- Static Public Attributes inherited from com.jogamp.common.util.locks.Lock
static final boolean DEBUG = Debug.debug("Lock")
 Enable via the property jogamp.debug.Lock More...
 
static final boolean TRACE_LOCK = Debug.isPropertyDefined("jogamp.debug.Lock.TraceLock", true)
 Enable via the property jogamp.debug.Lock.TraceLock More...
 
static final long DEFAULT_TIMEOUT = 5000
 The default TIMEOUT value, of {@value} ms. More...
 
static final long TIMEOUT = Debug.getLongProperty("jogamp.common.utils.locks.Lock.timeout", true, DEFAULT_TIMEOUT)
 The TIMEOUT for lock() in ms, defaults to DEFAULT_TIMEOUT. More...
 

Detailed Description

Definition at line 36 of file SingletonInstance.java.

Constructor & Destructor Documentation

◆ SingletonInstance()

com.jogamp.common.util.locks.SingletonInstance.SingletonInstance ( final long  poll_ms)
protected

Definition at line 65 of file SingletonInstance.java.

Member Function Documentation

◆ createFileLock() [1/2]

static SingletonInstance com.jogamp.common.util.locks.SingletonInstance.createFileLock ( final long  poll_ms,
final File  lockFile 
)
static

Definition at line 44 of file SingletonInstance.java.

◆ createFileLock() [2/2]

static SingletonInstance com.jogamp.common.util.locks.SingletonInstance.createFileLock ( final long  poll_ms,
final String  lockFileBasename 
)
static

Definition at line 40 of file SingletonInstance.java.

◆ createServerSocket()

static SingletonInstance com.jogamp.common.util.locks.SingletonInstance.createServerSocket ( final long  poll_ms,
final int  portNumber 
)
static

A user shall use ephemeral ports:

  • IANA suggests 49152 to 65535 as "dynamic and/or private ports".
  • Many GNU/Linux kernels use 32768 to 61000.
  • FreeBSD >= 4.6 uses the IANA port range.
  • FreeBSD < 4.6 and BSD use ports 1024 through 4999.
  • Microsoft Windows operating systems through Server 2003 use the range 1025 to 5000
  • Windows Vista, Windows 7, and Server 2008 use the IANA range.
Parameters
pollPeriod
portNumberto be used for this single instance server socket.

Definition at line 61 of file SingletonInstance.java.

Here is the caller graph for this function:

◆ getName()

abstract String com.jogamp.common.util.locks.SingletonInstance.getName ( )
abstract
Here is the caller graph for this function:

◆ getPollPeriod()

final long com.jogamp.common.util.locks.SingletonInstance.getPollPeriod ( )

Definition at line 69 of file SingletonInstance.java.

◆ infoPrefix() [1/2]

String com.jogamp.common.util.locks.SingletonInstance.infoPrefix ( )
protected

Definition at line 145 of file SingletonInstance.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ infoPrefix() [2/2]

String com.jogamp.common.util.locks.SingletonInstance.infoPrefix ( final long  currentMillis)
protected

Definition at line 142 of file SingletonInstance.java.

◆ isLocked()

synchronized boolean com.jogamp.common.util.locks.SingletonInstance.isLocked ( )

Query if locked.

Implements com.jogamp.common.util.locks.Lock.

Definition at line 138 of file SingletonInstance.java.

◆ lock()

synchronized void com.jogamp.common.util.locks.SingletonInstance.lock ( ) throws RuntimeException

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

Exceptions
RuntimeExceptionin case of TIMEOUT

Implements com.jogamp.common.util.locks.Lock.

Definition at line 75 of file SingletonInstance.java.

Here is the call graph for this function:

◆ toString()

final String com.jogamp.common.util.locks.SingletonInstance.toString ( )

Definition at line 72 of file SingletonInstance.java.

Here is the call graph for this function:

◆ tryLock()

synchronized boolean com.jogamp.common.util.locks.SingletonInstance.tryLock ( long  timeout) throws RuntimeException

Blocking until the lock is acquired by this Thread or maxwait in ms is reached.

Parameters
timeoutMaximum time in ms to wait to acquire the lock. If this value is zero, the call returns immediately either without being able to acquire the lock, or with acquiring the lock directly while ignoring any scheduling order.
Returns
true if the lock has been acquired within maxwait, otherwise false
Exceptions
InterruptedException

Implements com.jogamp.common.util.locks.Lock.

Definition at line 88 of file SingletonInstance.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tryLockImpl()

abstract boolean com.jogamp.common.util.locks.SingletonInstance.tryLockImpl ( )
abstractprotected
Here is the caller graph for this function:

◆ unlock()

void com.jogamp.common.util.locks.SingletonInstance.unlock ( ) throws RuntimeException

Release the lock.

Exceptions
RuntimeExceptionin case the lock is not acquired by this thread.

Implements com.jogamp.common.util.locks.Lock.

Definition at line 125 of file SingletonInstance.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unlockImpl()

abstract boolean com.jogamp.common.util.locks.SingletonInstance.unlockImpl ( )
abstractprotected
Here is the caller graph for this function:

Member Data Documentation

◆ DEBUG

final boolean com.jogamp.common.util.locks.SingletonInstance.DEBUG = true
staticprotected

Definition at line 38 of file SingletonInstance.java.


The documentation for this class was generated from the following file: