Update of /cvsroot/freenet/freenet/src/freenet/support
In directory sc8-pr-cvs1:/tmp/cvs-serv8270/src/freenet/support

Modified Files:
        BlockingQueue.java 
Log Message:
Run fast/immediate messages on a dedicated thread within the ticker instead of letting 
the scheduling thread run them

Index: BlockingQueue.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/BlockingQueue.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- BlockingQueue.java  9 Oct 2003 15:53:29 -0000       1.18
+++ BlockingQueue.java  14 Oct 2003 16:32:08 -0000      1.19
@@ -124,7 +124,20 @@
            }
         }
     }
-    
+    //Returns a snapshot of the current contents of the queue
+    public Object[] toArray(){
+               synchronized(queue) {
+                       Object[] a = new Object[queue.size()];
+                       Iterator it = queue.iterator();
+                       int index = 0;
+                       while(it.hasNext()){
+                               a[index] = it.next();
+                               index++;
+                       }
+                       return a;
+               }
+       
+    }
     // override in subclasses
     protected Object innerDequeue() {
        Object tmp = queue.removeFirst();

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to