Package org.jboss.util.threadpool
Class BasicThreadPool.TimeoutMonitor
- java.lang.Object
-
- org.jboss.util.threadpool.BasicThreadPool.TimeoutMonitor
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- BasicThreadPool
private class BasicThreadPool.TimeoutMonitor extends java.lang.Object implements java.lang.Runnable
The monitor runnable which validates that threads are completing within the task completion timeout limits.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) org.jboss.logging.Logger
log
-
Constructor Summary
Constructors Constructor Description TimeoutMonitor(java.lang.String name, org.jboss.logging.Logger log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
The monitor thread loops until the pool is shutdown.
-
-
-
Method Detail
-
run
public void run()
The monitor thread loops until the pool is shutdown. It waits for tasks with completion timeouts and sleeps until the next completion timeout and then interrupts the associated task thread, and invokes stopTask on the TaskWrapper. A new timeout check is then inserted with a 1 second timeout to validate that the TaskWrapper has exited the run method. If it has not, then the associated task thread is stopped using the deprecated Thread.stop method since this is the only way to abort a thread that is in spin loop for example.- Specified by:
run
in interfacejava.lang.Runnable
-
-