summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-04 11:32:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-04 11:32:16 +0000
commit1e3062ede1765f21c501068b3489c390c914e55f (patch)
tree8f2e09d2ca7299f49bd25ad410ce2dde8bc121d5 /eval.c
parent05e476c941e41132d40b4bcbfcc7eea90cae7318 (diff)
* eval.c (rb_thread_interrupt, rb_thread_signal_raise): no need to
save dead thread context. (same as [ruby-dev:18322]) (ruby-bugs-ja:PR#349) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index 9a81419..b5a09f5 100644
--- a/eval.c
+++ b/eval.c
@@ -9001,8 +9001,10 @@ rb_thread_interrupt()
if (curr_thread == main_thread) {
rb_interrupt();
}
- if (THREAD_SAVE_CONTEXT(curr_thread)) {
- return;
+ if (!rb_thread_dead(curr_thread)) {
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return;
+ }
}
curr_thread = main_thread;
rb_thread_restore_context(curr_thread, RESTORE_INTERRUPT);
@@ -9019,8 +9021,10 @@ rb_thread_signal_raise(sig)
rb_raise(rb_eSignal, "SIG%s", sig);
}
rb_thread_ready(main_thread);
- if (THREAD_SAVE_CONTEXT(curr_thread)) {
- return;
+ if (!rb_thread_dead(curr_thread)) {
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return;
+ }
}
th_signm = sig;
curr_thread = main_thread;
@@ -9072,8 +9076,10 @@ rb_thread_raise(argc, argv, th)
rb_f_raise(argc, argv);
}
- if (!rb_thread_dead(curr_thread) && THREAD_SAVE_CONTEXT(curr_thread)) {
- return th->thread;
+ if (!rb_thread_dead(curr_thread)) {
+ if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ return th->thread;
+ }
}
rb_scan_args(argc, argv, "11", &th_raise_argv[0], &th_raise_argv[1]);