From 39779e4796699c1b1aab9d61f525bfcb80d96833 Mon Sep 17 00:00:00 2001 From: apfelmaennchen Date: Sun, 14 Jun 2009 16:31:31 +0000 Subject: [PATCH] DidYouMean: as I moved to only 8 consumer and 4 producer threads, I removed poison pills as it does not make sense anymore - threads are interrupted directly. Having a consumer thread per test case just didn't make sense either (see svn 6070) due to the massive overhead. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6072 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/tools/DidYouMean.java | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/tools/DidYouMean.java b/source/de/anomic/tools/DidYouMean.java index 72dff5a8c..8bb7afffc 100644 --- a/source/de/anomic/tools/DidYouMean.java +++ b/source/de/anomic/tools/DidYouMean.java @@ -63,17 +63,31 @@ public class DidYouMean { } // check if timeout has been reached - while(((System.currentTimeMillis()-startTime) < TIMEOUT) && queue.size()>0) { - // consume more ... + boolean cont = false; + while(((System.currentTimeMillis()-startTime) < TIMEOUT)) { + if(queue.size()==0) { + // check if at least one producers is still running + for (int i=0; i0?"(timed out)":"")); + +(System.currentTimeMillis()-startTime)+"ms"+ " - remaining queue size: "+queue.size()); return this.set;