diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-21 18:55:50 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-21 18:55:50 +0000 |
commit | 51ba9a6b14207bd95b55727962b56b3c74855cb2 (patch) | |
tree | c703f36d101106c0b8c739386485be6989655b02 /cont.c | |
parent | 6d1940fed99ae106c4bbaaf22c9d41872e9e9de0 (diff) | |
download | ruby-51ba9a6b14207bd95b55727962b56b3c74855cb2.tar.gz |
* 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
Diffstat (limited to 'cont.c')
-rw-r--r-- | cont.c | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -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 |