X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fxwt%2Futil%2FQueue.java;h=8da10d4d8945abb522b51bfe7a260804a8a1f453;hb=16c24a73c1c1b2955db0bbbaf5a940215329bca1;hp=e2559e150cc5d1e309a9ad4676e19cdc3491daa6;hpb=5a42fe8ca9bdfc070dbf860d10d3f288e87e9a41;p=org.ibex.core.git diff --git a/src/org/xwt/util/Queue.java b/src/org/xwt/util/Queue.java index e2559e1..8da10d4 100644 --- a/src/org/xwt/util/Queue.java +++ b/src/org/xwt/util/Queue.java @@ -70,17 +70,11 @@ public class Queue { block is true and the queue is empty. */ public synchronized Object remove(boolean block) { - while (size == 0) { - if (!block) return null; - try { - wait(); - } catch (InterruptedException e) { - } catch (Exception e) { - if (Log.on) Log.log(this, "exception in Queue.wait(); this should never happen"); - if (Log.on) Log.log(this, e); - } + while (size == 0 && block) { + try { wait(); } catch (InterruptedException e) { } } + if (!block && size == 0) return null; Object ret = vec[first]; first++; size--;