[freenet-cvs] r14609 - trunk/freenet/src/freenet/support

toad at freenetproject.org toad at freenetproject.org
Sat Aug 11 16:16:22 UTC 2007


Author: toad
Date: 2007-08-11 16:16:22 +0000 (Sat, 11 Aug 2007)
New Revision: 14609

Modified:
   trunk/freenet/src/freenet/support/PooledExecutor.java
Log:
Use notifyAll() and explain why.

Modified: trunk/freenet/src/freenet/support/PooledExecutor.java
===================================================================
--- trunk/freenet/src/freenet/support/PooledExecutor.java	2007-08-11 15:48:13 UTC (rev 14608)
+++ trunk/freenet/src/freenet/support/PooledExecutor.java	2007-08-11 16:16:22 UTC (rev 14609)
@@ -37,7 +37,10 @@
 				if(t.nextJob != null) continue;
 				t.nextJob = job;
 				if(!mustStart)
-					t.notify();
+					// It is possible that we could get a wierd race condition with
+					// notify()/wait() signalling on a thread being used by higher
+					// level code. So we'd best use notifyAll().
+					t.notifyAll();
 			}
 			t.setName(jobName);
 			if(mustStart) {




More information about the cvs mailing list