mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add document to Fiber#transfer .
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user