boolean should_block = true;
if ( Arity.checkArgumentCount(context.getRuntime(), args, 0, 1) == 1 ) {
should_block = !args[0].isTrue();
}
if ( !should_block && entries.size() == 0 ) {
throw new RaiseException(context.getRuntime(), context.getRuntime().getThreadError(), "queue empty", false);
}
numWaiting++;
while ( entries.size() == 0 ) {
try {
wait();