Skip to content

Commit

Permalink
Add document to Fiber#transfer .
Browse files Browse the repository at this point in the history
  • Loading branch information
take-cheeze committed Apr 21, 2014
1 parent db440b8 commit 1d6b8ba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mrbgems/mruby-fiber/src/fiber.c
Expand Up @@ -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)
{
Expand Down

0 comments on commit 1d6b8ba

Please sign in to comment.