Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,16 @@ synchronized void start()
* initiated will not be processed any more. This method does nothing if
* the worker thread is not currently active.
* <p>
* If the worker thread does not terminate within 5 seconds it is killed
* by calling the (deprecated) <code>Thread.stop()</code> method. It may
* be that the worker thread may be blocked by a deadlock (it should not,
* though). In this case hope is that <code>Thread.stop()</code> will be
* able to released that deadlock at the expense of one or more tasks to
* not be executed any longer.... In any case an ERROR message is logged
* with the LogService in this situation.
* If the worker thread does not terminate within 5 seconds it is
* interrupted. It may be that the worker thread is blocked by a deadlock
* (it should not, though); interrupting it releases the thread if it is
* waiting on an interruptible operation, at the expense of one or more
* tasks not being executed any longer. In any case an ERROR message is
* logged with the LogService in this situation.
* <p>
* This used to call <code>Thread.stop()</code>, which has thrown
* <code>UnsupportedOperationException</code> since Java 20 and so could
* only turn a slow shutdown into a failed one.
*/
synchronized void terminate()
{
Expand All @@ -176,9 +179,9 @@ synchronized void terminate()
if ( workerThread.isAlive() )
{
Log.logger.log( LogService.LOG_ERROR,
"Worker thread {0} did not terminate within 5 seconds; trying to kill", new Object[]
"Worker thread {0} did not terminate within 5 seconds; interrupting it", new Object[]
{ workerBaseName } );
workerThread.stop();
workerThread.interrupt();
}
}
}
Expand Down
Loading