mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* cont.c (fiber_setcontext): Use swapcontext() instead longjmp().
[ruby-dev:41316] [Bug #3295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6d1940fed9
commit
51ba9a6b14
2 changed files with 6 additions and 10 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat May 22 03:53:05 2010 Satoshi Shiba <shiba@rvm.jp>
|
||||
|
||||
* cont.c (fiber_setcontext): Use swapcontext() instead longjmp().
|
||||
[ruby-dev:41316] [Bug #3295]
|
||||
|
||||
Fri May 21 19:11:42 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/nkf/nkf.c (rb_nkf_convert, rb_nkf_guess): check too huge
|
||||
|
|
11
cont.c
11
cont.c
|
@ -621,16 +621,7 @@ fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib)
|
|||
#ifdef _WIN32
|
||||
SwitchToFiber(newfib->fib_handle);
|
||||
#else
|
||||
if (!ruby_setjmp(oldfib->cont.jmpbuf)) {
|
||||
if (newfib->status != RUNNING) {
|
||||
if (setcontext(&newfib->context) < 0) {
|
||||
rb_bug("context switch between fiber failed");
|
||||
}
|
||||
}
|
||||
else {
|
||||
ruby_longjmp(newfib->cont.jmpbuf, 1);
|
||||
}
|
||||
}
|
||||
swapcontext(&oldfib->context, &newfib->context);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue