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

* cont.c (fiber_t_alloc): raise an error when fiber is going to be

initialized twice.  [ruby-dev:42524]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-11-03 17:08:35 +00:00
parent ea3c50885d
commit d433ec574a
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Thu Nov 4 02:06:16 2010 Yusuke Endoh <mame@tsg.ne.jp>
* cont.c (fiber_t_alloc): raise an error when fiber is going to be
initialized twice. [ruby-dev:42524]
Thu Nov 4 02:04:25 2010 Yusuke Endoh <mame@tsg.ne.jp>
* cont.c (rb_fiber_resume): raise an "double resume" error when root

4
cont.c
View file

@ -971,6 +971,10 @@ fiber_t_alloc(VALUE fibval)
rb_fiber_t *fib;
rb_thread_t *th = GET_THREAD();
if (DATA_PTR(fibval) != 0) {
rb_raise(rb_eRuntimeError, "cannot initialize twice");
}
THREAD_MUST_BE_RUNNING(th);
fib = ALLOC(rb_fiber_t);
memset(fib, 0, sizeof(rb_fiber_t));