ruby-changes:22481
From: naruse <ko1@a...>
Date: Fri, 10 Feb 2012 05:25:12 +0900 (JST)
Subject: [ruby-changes:22481] naruse:r34530 (ruby_1_9_3): Partially revert r27949.
naruse 2012-02-10 05:25:01 +0900 (Fri, 10 Feb 2012) New Revision: 34530 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34530 Log: Partially revert r27949. * cont.c (fiber_setcontext): Use longjmp() instead of swapcontext() on FreeBSD 9. [ruby-dev:41316] [Bug #3295] [Bug #5526] Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/cont.c branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 34529) +++ ruby_1_9_3/ChangeLog (revision 34530) @@ -1,3 +1,8 @@ +Fri Feb 10 05:22:32 2012 NARUSE, Yui <naruse@r...> + + * cont.c (fiber_setcontext): Use longjmp() instead of swapcontext() on + FreeBSD 9. [ruby-dev:41316] [Bug #3295] [Bug #5526] + Fri Feb 10 05:13:12 2012 Ayumu AIZAWA <ayumu.aizawa@g...> * object.c: Added examples for Object#is_a? and Index: ruby_1_9_3/cont.c =================================================================== --- ruby_1_9_3/cont.c (revision 34529) +++ ruby_1_9_3/cont.c (revision 34530) @@ -646,6 +646,17 @@ /* swap machine context */ #ifdef _WIN32 SwitchToFiber(newfib->fib_handle); +#elif defined(__FreeBSD__) /* FreeBSD 9 doesn't work with swapcontext */ + 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); + } + } #else swapcontext(&oldfib->context, &newfib->context); #endif Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 34529) +++ ruby_1_9_3/version.h (revision 34530) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 78 +#define RUBY_PATCHLEVEL 79 #define RUBY_RELEASE_DATE "2012-02-10" #define RUBY_RELEASE_YEAR 2012 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/