aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/cont.c b/cont.c
index c0c361920e..dec3b01908 100644
--- a/cont.c
+++ b/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