diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-20 18:05:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-20 18:05:40 +0000 |
commit | 02da16b16777bb21dcd7a91c895fb4fe0e2075a9 (patch) | |
tree | 595825d651d787a536ade33d51bfbbaffc6eace1 /eval.c | |
parent | b21b9a46cfadc785f0001b2b34edc0392d79161b (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.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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; { |