Commit 1d6b8ba5 authored by take_cheeze's avatar take_cheeze

Add document to Fiber#transfer .

parent db440b82
......@@ -234,6 +234,18 @@ fiber_eq(mrb_state *mrb, mrb_value self)
return mrb_bool_value(fiber_ptr(self) == fiber_ptr(other));
}
/*
* call-seq:
* fiber.transfer(args, ...) -> obj
*
* Transfers control to reciever fiber of the method call.
* Unlike <code>resume</code> the reciever wouldn't be pushed to call
* stack of fibers. Instead it will switch to the call stack of
* transferring fiber.
* When resuming a fiber that was transferred to another fiber it would
* cause double resume error. Though when the fiber is re-transferred
* and <code>Fiber.yield</code> is called, the fiber would be resumable.
*/
static mrb_value
fiber_transfer(mrb_state *mrb, mrb_value self)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment