294295296297298299300301302303304
new Runnable() { @Override public void run() { AnnotatedRunnable drainer = mockExecutor.removeHead(); drainer.run(); } }, "drainer" ); // once the queue is empty, we know the drainer has taken the task out and is blocked on the
383384385386387388389390391392393
@Override public void run() { AnnotatedRunnable drainer = mockExecutor.removeHead(); if (drainer != null) { drainer.run(); } else { try { Thread.sleep(10); } catch (InterruptedException e) { throw new RuntimeException(e);
404405406407408409410411412413414
new Runnable() { @Override public void run() { AnnotatedRunnable drainer = mockExecutor.removeHead(); drainer.run(); } }, "original" ); }
288289290291292293294295296297298
377378379380381382383384385386387
398399400401402403404405406407408