From 97cdb5ac25ddcf0e7664867f39ccaccc4d139c0e Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 24 Dec 2007 08:59:31 +0000 Subject: [PATCH] * load.c (load_lock): reverted. * thread.c (rb_barrier_wait): check for recursive wait. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ load.c | 3 +-- thread.c | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e226a12cb30d90..5987e07f935a67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Dec 24 17:59:29 2007 Nobuyoshi Nakada + + * load.c (load_lock): reverted. + + * thread.c (rb_barrier_wait): check for recursive wait. + Mon Dec 24 17:50:54 2007 Tanaka Akira * eval.c (function_call_may_return_twice_jmp_buf): removed. diff --git a/load.c b/load.c index bc80e0b154e798..a334fd6ee75ad7 100644 --- a/load.c +++ b/load.c @@ -345,8 +345,7 @@ load_lock(const char *ftptr) st_insert(loading_tbl, (st_data_t)ftptr, data); return (char *)ftptr; } - rb_barrier_wait((VALUE)data); - return 0; + return RTEST(rb_barrier_wait((VALUE)data)) ? (char *)ftptr : 0; } static void diff --git a/thread.c b/thread.c index 5fd2033f0802d6..ae0c3b3bfbaf3a 100644 --- a/thread.c +++ b/thread.c @@ -2555,6 +2555,9 @@ rb_barrier_wait(VALUE self) if (thlist_signal(&barrier->waiting, 1, &barrier->owner)) return Qfalse; return Qtrue; } + else if (barrier->owner == GET_THREAD()) { + return Qfalse; + } else { *barrier->tail = q = ALLOC(rb_thread_list_t); q->th = GET_THREAD();