1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* cont.c: Improved Fiber documentation.[ruby-core:44540][Bug #6343]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ayumin 2012-05-02 10:13:28 +00:00
parent 8de9bb275f
commit 6f72a6dcb5
2 changed files with 31 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Wed May 2 19:06:30 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
* cont.c (rb_fiber_m_transfer): Improved Fiber documentation.
patched by Anuj Dutta. [ruby-core:44540][Bug #6343]
Wed May 2 13:06:37 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* README, README.ja: reformatted using rdoc markup. based on the

26
cont.c
View file

@ -1425,6 +1425,32 @@ rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
* You cannot resume a fiber that transferred control to another one.
* This will cause a double resume error. You need to transfer control
* back to this fiber before it can yield and resume.
*
* Example:
*
* fiber1 = Fiber.new do
* puts "In Fiber 1"
* Fiber.yield
* end
*
* fiber2 = Fiber.new do
* puts "In Fiber 2"
* fiber1.transfer
* end
*
* fiber3 = Fiber.new do
* puts "In Fiber 3"
* end
*
* fiber2.resume
* fiber3.resume
*
* <em>produces</em>
*
* I am in fiber2
* I am in fiber1
* I am in fiber3
*
*/
static VALUE
rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval)