Skip to content

Commit

Permalink
mruby-fiber: add Fiber.yield description; close #3066
Browse files Browse the repository at this point in the history
Fiber.yield cannot be called from #initialize which is called by
mrb_funcall().  It is mruby limitation.
  • Loading branch information
matz committed Dec 31, 2015
1 parent 31b8469 commit 38b9c2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mrbgems/mruby-fiber/src/fiber.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ mrb_fiber_yield(mrb_state *mrb, mrb_int len, const mrb_value *a)
* along any arguments that were passed to it. The fiber will resume
* processing at this point when <code>resume</code> is called next.
* Any arguments passed to the next <code>resume</code> will be the
* value that this <code>Fiber.yield</code> expression evaluates to.
*
* mruby limitation: Fiber resume/yield cannot cross C function boundary.
* thus you cannot yield from #initialize which is called by mrb_funcall().
*/
static mrb_value
fiber_yield(mrb_state *mrb, mrb_value self)
Expand Down

0 comments on commit 38b9c2d

Please sign in to comment.