You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by sg...@apache.org on 2001/03/09 13:33:23 UTC
cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/threadpool RunnableThread.java
sgala 01/03/09 04:33:23
Modified: src/java/org/apache/jetspeed/services/threadpool
RunnableThread.java
Log:
Solved a problem with synchronization that made occassional thread lossage in SMP machines
Revision Changes Path
1.4 +9 -6 jakarta-jetspeed/src/java/org/apache/jetspeed/services/threadpool/RunnableThread.java
Index: RunnableThread.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/threadpool/RunnableThread.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RunnableThread.java 2001/03/07 06:49:23 1.3
+++ RunnableThread.java 2001/03/09 12:33:23 1.4
@@ -64,7 +64,8 @@
* process if getRunnable != null.
*
* @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
- * @version $Id: RunnableThread.java,v 1.3 2001/03/07 06:49:23 taylor Exp $
+ * @author <a href="mailto:sgala@apache.org">Santiago Gala</a>
+ * @version $Id: RunnableThread.java,v 1.4 2001/03/09 12:33:23 sgala Exp $
*/
public class RunnableThread extends Thread {
@@ -120,11 +121,17 @@
*/
public void run() {
- while ( true ) {
+ /*
+ FIXME: move to a static class variable to allow for pool shutdown
+ */
+ boolean poolrunning = true;
+ while ( poolrunning ) {
//On creation, we are idle.
//So, add ourselves to the Pool.
+ //Next times we come here, we are just finished
+ //one run...
this.setRunning( false );
this.setRunnable( null );
@@ -144,10 +151,6 @@
//yield this thread so that other threads can now execute
//if necessary.
//this.yield();
-
- //Also, I wonder if we are making something wrong here...
- //I think we need synchronization since we release till the
- //wait up there at the beginning of the block.
//ok... add this thread back into the thread pool
( (JetspeedThreadPoolService)TurbineServices
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org