311312313314315316317318319320
throw new QueueClosedException(); /*get the next value*/ Object retval=removeInternal(); /*null result means we timed out*/ if(retval == null) throw new TimeoutException("timeout=" + timeout + "ms"); return retval; } }
436437438439440441442443444445446
if(closed) throw new QueueClosedException(); retval=head != null? head.obj : null; if(retval == null) throw new TimeoutException("timeout=" + timeout + "ms"); if(retval == endMarker) { close(false); throw new QueueClosedException(); }
141142143144145146147148
*/ protected T _getResultWithTimeout(final long timeout) throws TimeoutException { if(timeout <= 0) cond.waitFor(this); else if(!cond.waitFor(this, timeout, TimeUnit.MILLISECONDS)) throw new TimeoutException(); return result; }
288289290291292293294
views[i]=channels[i].getView(); sb.append(channels[i].getName()).append(": ").append(views[i]).append("\n"); } for(View view : views) if(view == null || view.size() != size) throw new TimeoutException("Timeout " + timeout + " kicked in, views are:\n" + sb); }
34353637383940
static Object foo() { return "foo(): OK"; } static Object bar() throws Exception { throw new TimeoutException("this is an exception"); }