summaryrefslogtreecommitdiff
path: root/rubysig.h
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-19 14:12:04 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-19 14:12:04 +0000
commit222ee5ee461a130dff29cbaa6014526e7c2d1df5 (patch)
tree7145fac9656a81aa73ccd6a425d5d55c80ef9753 /rubysig.h
parentd53ad837dde3b6a29cefa9e209ad2d9af26be5c9 (diff)
* rubysig.h (CHECK_INTS): prevent signal handler to run during
critical section. [ruby-core:04039] * eval.c (load_wait): need not to call rb_thread_schedule() explicitly. [ruby-core:04039] * eval.c (rb_thread_schedule): clear rb_thread_critical. [ruby-core:04039] * st.c (st_free_table): do not call free() but xfree(). [ruby-core:06205] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rubysig.h')
-rw-r--r--rubysig.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/rubysig.h b/rubysig.h
index 232921e..dd3b135 100644
--- a/rubysig.h
+++ b/rubysig.h
@@ -82,10 +82,9 @@ void rb_thread_schedule _((void));
#if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
RUBY_EXTERN int rb_thread_pending;
# define CHECK_INTS do {\
- if (!rb_prohibit_interrupt) {\
+ if (!(rb_prohibit_interrupt | rb_thread_critical)) {\
+ if (rb_thread_pending) rb_thread_schedule();\
if (rb_trap_pending) rb_trap_exec();\
- if (rb_thread_pending && !rb_thread_critical)\
- rb_thread_schedule();\
}\
} while (0)
#else
@@ -93,15 +92,13 @@ RUBY_EXTERN int rb_thread_pending;
RUBY_EXTERN int rb_thread_tick;
#define THREAD_TICK 500
#define CHECK_INTS do {\
- if (!rb_prohibit_interrupt) {\
- if (rb_trap_pending) rb_trap_exec();\
- if (!rb_thread_critical) {\
- if (rb_thread_tick-- <= 0) {\
- rb_thread_tick = THREAD_TICK;\
- rb_thread_schedule();\
- }\
+ if (!(rb_prohibit_interrupt | rb_thread_critical)) {\
+ if (rb_thread_tick-- <= 0) {\
+ rb_thread_tick = THREAD_TICK;
+ rb_thread_schedule();
}\
}\
+ if (rb_trap_pending) rb_trap_exec();\
} while (0)
#endif