ruby-changes:16002
From: kosaki <ko1@a...>
Date: Sat, 22 May 2010 03:57:43 +0900 (JST)
Subject: [ruby-changes:16002] Ruby:r27949 (trunk): * cont.c (fiber_setcontext): Use swapcontext() instead longjmp().
kosaki 2010-05-22 03:55:50 +0900 (Sat, 22 May 2010) New Revision: 27949 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27949 Log: * cont.c (fiber_setcontext): Use swapcontext() instead longjmp(). [ruby-dev:41316] [Bug #3295] Modified files: trunk/ChangeLog trunk/cont.c Index: ChangeLog =================================================================== --- ChangeLog (revision 27948) +++ ChangeLog (revision 27949) @@ -1,3 +1,8 @@ +Sat May 22 03:53:05 2010 Satoshi Shiba <shiba@r...> + + * cont.c (fiber_setcontext): Use swapcontext() instead longjmp(). + [ruby-dev:41316] [Bug #3295] + Fri May 21 19:11:42 2010 Nobuyoshi Nakada <nobu@r...> * ext/nkf/nkf.c (rb_nkf_convert, rb_nkf_guess): check too huge Index: cont.c =================================================================== --- cont.c (revision 27948) +++ cont.c (revision 27949) @@ -621,16 +621,7 @@ #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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/