ActiveMonitor¶
-
public class
ActiveMonitor
¶ ActiveMonitor is a thread monitor of active threads.
Author: Hugo Y. K. Lam See also:
ActiveThread
Methods¶
acquireThread¶
-
public synchronized ActiveThread
acquireThread
()¶ Acquires a new active thread. This method will block if the maximum number of threads has been reached.
Returns: a new active thread or null if the monitor is suspended.
getMaxThreadCount¶
-
public int
getMaxThreadCount
()¶ Gets the maximum number of threads this monitor allows to acquire.
Returns: the maximum number.
getPeekThreadCount¶
-
public int
getPeekThreadCount
()¶ Gets the peek number of threads being acquired.
Returns: the peek number of threads being acquired.
getThreadCount¶
-
public int
getThreadCount
()¶ Gets the current number of threads being acquired.
Returns: the current number of threads being acquired.
releaseThread¶
-
public synchronized void
releaseThread
(ActiveThread thread)¶ Releases a previously acquired thread.
Parameters: - thread – the previously acquired thread.