public IRubyObject pop(ThreadContext context) { return pop(context, true); }
public IRubyObject pop(ThreadContext context) { return pop(context, true); }
public IRubyObject pop(ThreadContext context, IRubyObject arg0) { return pop(context, !arg0.isTrue()); }
public IRubyObject pop(ThreadContext context, IRubyObject arg0) { return pop(context, !arg0.isTrue()); }
private static IRubyObject exchangeWithFiber(ThreadContext context, FiberData currentFiberData, FiberData targetFiberData, IRubyObject val) { // At this point we consider ourselves "in" the resume, so we need to enforce exception-propagation // rules for both the push (to wake up fiber) and pop (to wait for fiber). Failure to do this can // cause interrupts destined for the fiber to be caught after the fiber is running but before the // resuming thread has started waiting for it, leaving the fiber to run rather than receiving the // interrupt, and the parent thread propagates the error. // Note: these need to be separate try/catches because of the while loop. try { targetFiberData.queue.push(context, new IRubyObject[] {val}); } catch (RaiseException re) { handleExceptionDuringExchange(context, currentFiberData, targetFiberData, re); } while (true) { try { IRubyObject result = currentFiberData.queue.pop(context); return result == NEVER ? context.nil : result; } catch (RaiseException re) { handleExceptionDuringExchange(context, currentFiberData, targetFiberData, re); } } }
private static IRubyObject exchangeWithFiber(ThreadContext context, FiberData currentFiberData, FiberData targetFiberData, IRubyObject val) { // At this point we consider ourselves "in" the resume, so we need to enforce exception-propagation // rules for both the push (to wake up fiber) and pop (to wait for fiber). Failure to do this can // cause interrupts destined for the fiber to be caught after the fiber is running but before the // resuming thread has started waiting for it, leaving the fiber to run rather than receiving the // interrupt, and the parent thread propagates the error. // Note: these need to be separate try/catches because of the while loop. try { targetFiberData.queue.push(context, new IRubyObject[] {val}); } catch (RaiseException re) { handleExceptionDuringExchange(context, currentFiberData, targetFiberData, re); } while (true) { try { IRubyObject result = currentFiberData.queue.pop(context); return result == NEVER ? context.nil : result; } catch (RaiseException re) { handleExceptionDuringExchange(context, currentFiberData, targetFiberData, re); } } }
IRubyObject init = data.queue.pop(context);
IRubyObject init = data.queue.pop(context);