diff --git a/Common/src/com/common/thread/ThreadService.java b/Common/src/com/common/thread/ThreadService.java index 498169e..6c8fa67 100644 --- a/Common/src/com/common/thread/ThreadService.java +++ b/Common/src/com/common/thread/ThreadService.java @@ -146,10 +146,10 @@ public class ThreadService { //Wait until the thread is told to run again// try { //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(); - }//if// + }//while// }//try// catch(InterruptedException e) { return; @@ -283,9 +283,12 @@ private synchronized void _shutdown() { //Stop the thread creator.// if(threadCreator != null) { - threadCreator.stop(); + synchronized(threadCreator) { + threadCreator.stop(); + threadCreator.notifyAll(); + }//synchronized// + threadCreator = null; - notifyAll(); }//if// threadIterator = getThreadPool().iterator();