From 263beca3e694fe440e70ec89b1469bcb010e8bcd Mon Sep 17 00:00:00 2001 From: jeremy Date: Wed, 9 Nov 2011 19:23:35 +0000 Subject: [PATCH] Backport svn revision 33693, fixes threading bootstrap test failure. --- lang/ruby/1.9/Makefile | 4 ++- .../patch-bootstraptest_test_thread_rb | 15 -------- lang/ruby/1.9/patches/patch-thread_pthread_c | 36 +++++++++++++++++++ 3 files changed, 39 insertions(+), 16 deletions(-) delete mode 100644 lang/ruby/1.9/patches/patch-bootstraptest_test_thread_rb create mode 100644 lang/ruby/1.9/patches/patch-thread_pthread_c diff --git a/lang/ruby/1.9/Makefile b/lang/ruby/1.9/Makefile index 43cdbd87fc8..a11c0924693 100644 --- a/lang/ruby/1.9/Makefile +++ b/lang/ruby/1.9/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.18 2011/11/08 23:38:57 jeremy Exp $ +# $OpenBSD: Makefile,v 1.19 2011/11/09 19:23:35 jeremy Exp $ COMMENT-main = object oriented script language with threads COMMENT-gdbm = gdbm interface for ruby @@ -17,6 +17,8 @@ PKGNAME-dbm = ruby-dbm-${VERSION}.${PATCHLEVEL} PKGNAME-tk = ruby-tk-${VERSION}.${PATCHLEVEL} PKGNAME-ri_docs = ruby-ri_docs-${VERSION}.${PATCHLEVEL} +REVISION-main = 0 + PKGSPEC-main = ruby->=1.9,<1.10 CONFIGURE_ARGS = --program-suffix=19 \ diff --git a/lang/ruby/1.9/patches/patch-bootstraptest_test_thread_rb b/lang/ruby/1.9/patches/patch-bootstraptest_test_thread_rb deleted file mode 100644 index 4a6c1737bbb..00000000000 --- a/lang/ruby/1.9/patches/patch-bootstraptest_test_thread_rb +++ /dev/null @@ -1,15 +0,0 @@ -$OpenBSD: patch-bootstraptest_test_thread_rb,v 1.1 2011/11/08 23:38:57 jeremy Exp $ - -Skip a threading test that hits an infinite loop bug. - ---- bootstraptest/test_thread.rb.orig Sun Oct 30 20:22:36 2011 -+++ bootstraptest/test_thread.rb Sun Oct 30 20:24:33 2011 -@@ -53,7 +53,7 @@ assert_equal %q{100}, %q{ - 100.times{ - Thread.new{loop{Thread.pass}} - } --} -+} if false - assert_equal %q{ok}, %q{ - Thread.new{ - :ok diff --git a/lang/ruby/1.9/patches/patch-thread_pthread_c b/lang/ruby/1.9/patches/patch-thread_pthread_c new file mode 100644 index 00000000000..8ed3e2b2082 --- /dev/null +++ b/lang/ruby/1.9/patches/patch-thread_pthread_c @@ -0,0 +1,36 @@ +$OpenBSD: patch-thread_pthread_c,v 1.1 2011/11/09 19:23:35 jeremy Exp $ + +Backport svn revision 33693, fixes bootstrap thread test failure. + +--- thread_pthread.c.orig Thu Sep 22 03:45:23 2011 ++++ thread_pthread.c Wed Nov 9 09:37:52 2011 +@@ -109,16 +109,13 @@ gvl_yield(rb_vm_t *vm, rb_thread_t *th) + goto acquire; + } + +- vm->gvl.wait_yield = 1; +- +- if (vm->gvl.waiting > 0) +- vm->gvl.need_yield = 1; +- +- if (vm->gvl.need_yield) { ++ if (vm->gvl.waiting > 0) { + /* Wait until another thread task take GVL. */ +- while (vm->gvl.need_yield) { ++ vm->gvl.need_yield = 1; ++ vm->gvl.wait_yield = 1; ++ while (vm->gvl.need_yield) + native_cond_wait(&vm->gvl.switch_cond, &vm->gvl.lock); +- } ++ vm->gvl.wait_yield = 0; + } + else { + native_mutex_unlock(&vm->gvl.lock); +@@ -126,7 +123,6 @@ gvl_yield(rb_vm_t *vm, rb_thread_t *th) + native_mutex_lock(&vm->gvl.lock); + } + +- vm->gvl.wait_yield = 0; + native_cond_broadcast(&vm->gvl.switch_wait_cond); + acquire: + gvl_acquire_common(vm);