directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: rev 56131 - incubator/directory/seda/trunk/src/java/org/apache/seda/thread
Date Sun, 31 Oct 2004 07:58:55 GMT
Author: trustin
Date: Sun Oct 31 00:58:55 2004
New Revision: 56131

Modified:
   incubator/directory/seda/trunk/src/java/org/apache/seda/thread/OrderedThreadPool.java
Log:
OrderedThreadPool does not cast hint into ClientKey anymore.

Modified: incubator/directory/seda/trunk/src/java/org/apache/seda/thread/OrderedThreadPool.java
==============================================================================
--- incubator/directory/seda/trunk/src/java/org/apache/seda/thread/OrderedThreadPool.java
(original)
+++ incubator/directory/seda/trunk/src/java/org/apache/seda/thread/OrderedThreadPool.java
Sun Oct 31 00:58:55 2004
@@ -17,9 +17,6 @@
 
 package org.apache.seda.thread;
 
-import org.apache.seda.listener.ClientKey;
-
-
 /**
  * @author Trustin Lee
  */
@@ -41,9 +38,9 @@
     {
         start();
 
-        if (hint instanceof ClientKey)
+        if (hint != null)
         {
-            getWorker((ClientKey) hint).localEventQueue.push(runnable);
+            getWorker(hint).localEventQueue.push(runnable);
         }
         else
         {
@@ -58,10 +55,10 @@
         return (Worker) workers.get(workerIdx);
     }
 
-    private Worker getWorker(ClientKey key)
+    private Worker getWorker(Object hint)
     {
         return (Worker) workers.get(Math.abs(System.identityHashCode(this) ^
-                                             key.hashCode()) % this.getThreadPoolSize());
+                                             hint.hashCode()) % this.getThreadPoolSize());
     }
 
     private class Worker extends AbstractWorker

Mime
View raw message