diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-01 07:43:05 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-12-01 07:43:05 +0000 |
commit | 26474005b0dd56b0df7fc9c12f7ee4f2093b02b3 (patch) | |
tree | 0b2c416f4071e9c88294f92c2228f84f3d759ff5 /ext/tk | |
parent | f114b85d89cf98cf4a11731615df77e50901d0c1 (diff) |
* ext/tk/tcltklib.c: shouldn't run the killed thread at callback.
[ruby-talk: 227408]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/tcltklib.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index 9a6449adc6..10b79f2970 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -4,7 +4,7 @@ * Oct. 24, 1997 Y. Matsumoto */ -#define TCLTKLIB_RELEASE_DATE "2006-07-10" +#define TCLTKLIB_RELEASE_DATE "2006-12-01" #include "ruby.h" #include "rubysig.h" @@ -5526,10 +5526,15 @@ call_queue_handler(evPtr, flags) *(q->done) = -1; /* back to caller */ - DUMP2("back to caller (caller thread:%lx)", q->thread); - DUMP2(" (current thread:%lx)", rb_thread_current()); - rb_thread_run(q->thread); - DUMP1("finish back to caller"); + if (RTEST(rb_funcall(q->thread, ID_alive_p, 0, 0))) { + DUMP2("back to caller (caller thread:%lx)", q->thread); + DUMP2(" (current thread:%lx)", rb_thread_current()); + rb_thread_run(q->thread); + DUMP1("finish back to caller"); + } else { + DUMP2("caller is dead (caller thread:%lx)", q->thread); + DUMP2(" (current thread:%lx)", rb_thread_current()); + } /* end of handler : remove it */ return 1; @@ -5844,10 +5849,15 @@ eval_queue_handler(evPtr, flags) *(q->done) = -1; /* back to caller */ - DUMP2("back to caller (caller thread:%lx)", q->thread); - DUMP2(" (current thread:%lx)", rb_thread_current()); - rb_thread_run(q->thread); - DUMP1("finish back to caller"); + if (RTEST(rb_funcall(q->thread, ID_alive_p, 0, 0))) { + DUMP2("back to caller (caller thread:%lx)", q->thread); + DUMP2(" (current thread:%lx)", rb_thread_current()); + rb_thread_run(q->thread); + DUMP1("finish back to caller"); + } else { + DUMP2("caller is dead (caller thread:%lx)", q->thread); + DUMP2(" (current thread:%lx)", rb_thread_current()); + } /* end of handler : remove it */ return 1; @@ -6921,10 +6931,15 @@ invoke_queue_handler(evPtr, flags) *(q->done) = -1; /* back to caller */ - DUMP2("back to caller (caller thread:%lx)", q->thread); - DUMP2(" (current thread:%lx)", rb_thread_current()); - rb_thread_run(q->thread); - DUMP1("finish back to caller"); + if (RTEST(rb_funcall(q->thread, ID_alive_p, 0, 0))) { + DUMP2("back to caller (caller thread:%lx)", q->thread); + DUMP2(" (current thread:%lx)", rb_thread_current()); + rb_thread_run(q->thread); + DUMP1("finish back to caller"); + } else { + DUMP2("caller is dead (caller thread:%lx)", q->thread); + DUMP2(" (current thread:%lx)", rb_thread_current()); + } /* end of handler : remove it */ return 1; |