summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-20 18:05:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-20 18:05:40 +0000
commit02da16b16777bb21dcd7a91c895fb4fe0e2075a9 (patch)
tree595825d651d787a536ade33d51bfbbaffc6eace1 /eval.c
parentb21b9a46cfadc785f0001b2b34edc0392d79161b (diff)
* eval.c, intern.h, ext/thread/thread.c: should not free queue while
any live threads are waiting. [ruby-dev:30653] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index a1f4eb3eb9..5903dc97c1 100644
--- a/eval.c
+++ b/eval.c
@@ -6826,7 +6826,6 @@ rb_load(fname, wrap)
volatile VALUE self = ruby_top_self;
NODE *volatile last_node;
NODE *saved_cref = ruby_cref;
- TMP_PROTECT;
if (wrap && ruby_safe_level >= 4) {
StringValue(fname);
@@ -11234,10 +11233,19 @@ VALUE
rb_thread_wakeup(thread)
VALUE thread;
{
+ if (!RTEST(rb_thread_wakeup_alive(thread)))
+ rb_raise(rb_eThreadError, "killed thread");
+ return thread;
+}
+
+VALUE
+rb_thread_wakeup_alive(thread)
+ VALUE thread;
+{
rb_thread_t th = rb_thread_check(thread);
if (th->status == THREAD_KILLED)
- rb_raise(rb_eThreadError, "killed thread");
+ return Qnil;
rb_thread_ready(th);
return thread;
@@ -12173,7 +12181,7 @@ rb_thread_status(thread)
* thr.alive? #=> false
*/
-static VALUE
+VALUE
rb_thread_alive_p(thread)
VALUE thread;
{