From: megacz Date: Fri, 30 Jan 2004 08:05:29 +0000 (+0000) Subject: 2004/01/27 05:22:40 X-Git-Tag: RC3~98 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=53d199993605c1ad63f3bbe8e2cbab64c17202e1 2004/01/27 05:22:40 darcs-hash:20040130080529-2ba56-92539ea64bfc0cacc192d3826fc1bd60be102ca2.gz --- diff --git a/src/org/xwt/util/Queue.java b/src/org/xwt/util/Queue.java index 7d74b9c..eb36a4d 100644 --- a/src/org/xwt/util/Queue.java +++ b/src/org/xwt/util/Queue.java @@ -70,9 +70,14 @@ public class Queue { block is true and the queue is empty. */ public synchronized Object remove(boolean block) { - try { wait(); } catch (InterruptedException e) { } - if (!block) return null; + while (size == 0 && block) { + try { + wait(); + } catch (InterruptedException e) { + } + } + if (!block) return null; Object ret = vec[first]; first++; size--;