Skip to content

Commit

Permalink
Fix blocking in SizedQueue#push
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Jan 3, 2024
1 parent 4278f07 commit a1ab000
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/org/jruby/ext/thread/SizedQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ public IRubyObject push(ThreadContext context, final IRubyObject arg0, final IRu
boolean should_block = arg1.isTrue();

try {
return context.getThread().executeTaskBlocking(context, arg0, should_block ? blockingPushTask : nonblockingPushTask);
if (should_block) {
return context.getThread().executeTaskBlocking(context, arg0, blockingPushTask);
}

return context.getThread().executeTask(context, arg0, nonblockingPushTask);
} catch (InterruptedException ie) {
throw createInterruptedError(context, "push");
}
Expand Down

0 comments on commit a1ab000

Please sign in to comment.