Fixed bug in stopping the ThreadCreator when shutting down the ThreadService.

This commit is contained in:
wcrisman
2014-07-17 14:28:08 -07:00
parent 499a70091b
commit 3cf6011121

View File

@@ -146,10 +146,10 @@ public class ThreadService {
//Wait until the thread is told to run again// //Wait until the thread is told to run again//
try { try {
//Make sure we don't have a target.// //Make sure we don't have a target.//
if((target = getTarget()) == null) { while((target = getTarget()) == null) {
//Wait for the next run of this thread// //Wait for the next run of this thread//
wait(); wait();
}//if// }//while//
}//try// }//try//
catch(InterruptedException e) { catch(InterruptedException e) {
return; return;
@@ -283,9 +283,12 @@ private synchronized void _shutdown() {
//Stop the thread creator.// //Stop the thread creator.//
if(threadCreator != null) { if(threadCreator != null) {
threadCreator.stop(); synchronized(threadCreator) {
threadCreator.stop();
threadCreator.notifyAll();
}//synchronized//
threadCreator = null; threadCreator = null;
notifyAll();
}//if// }//if//
threadIterator = getThreadPool().iterator(); threadIterator = getThreadPool().iterator();