summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--cont.c11
-rw-r--r--version.h2
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 70532395c6..30fd8903fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/cont.c b/cont.c
index 490ffac80b..76146179b6 100644
--- a/cont.c
+++ b/cont.c
@@ -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
diff --git a/version.h b/version.h
index be2e6e53fb..0876879f78 100644
--- a/version.h
+++ b/version.h
@@ -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