Commits

Anonymous committed 15debf9

Comments (0)

Files changed (1)

src/java/org/quartz/simpl/SimpleThreadPool.java

 
         synchronized (nextRunnableLock) {
 
+            // Wait until a worker thread has taken the previous Runnable
+            // or until the thread pool is asked to shutdown.
+            while ((nextRunnable != null) && !isShutdown) {
+                try {
+                    nextRunnableLock.wait(1000);
+                } catch (InterruptedException ignore) {
+                }
+            }
+
             if(availCount < 1 ) {
                 return false;
             }