diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | cont.c | 11 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 17 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Feb 10 05:22:32 2012 NARUSE, Yui <naruse@ruby-lang.org> + + * 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@gmail.com> * object.c: Added examples for Object#is_a? and @@ -646,6 +646,17 @@ fiber_setcontext(rb_fiber_t *newfib, rb_fiber_t *oldfib) /* 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 @@ -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 |