summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-26 12:17:10 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-26 12:17:10 +0000
commit66e2e6ee697a322bb7521d7ecaff6be3fb69f4dd (patch)
tree1f0b805629f7b8fbaca900664c7866c9d6f70494 /vm_core.h
parent58543f00b6386b5631ffc6d8f029be149d632457 (diff)
* vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT)
(RUBY_VM_SET_FINALIZER_INTERRUPT, RUBY_VM_SET_TRAP_INTERRUPT) (RUBY_VM_INTERRUPTED): use enum symbol instead of immediate value. * thread.c (thread_join_m, rb_threadptr_execute_interrupts): ditto. * signal.c (signal_exec): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/vm_core.h b/vm_core.h
index 8a9c4e63e4..f9b6181f54 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -855,11 +855,18 @@ GET_THREAD(void)
#error "unsupported thread model"
#endif
-#define RUBY_VM_SET_TIMER_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, 0x01)
-#define RUBY_VM_SET_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, 0x02)
-#define RUBY_VM_SET_FINALIZER_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, 0x04)
-#define RUBY_VM_SET_TRAP_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, 0x08)
-#define RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & 0x0A & ~(th)->interrupt_mask)
+enum {
+ TIMER_INTERRUPT_MASK = 0x01,
+ ASYNC_ERRINFO_INTERRUPT_MASK = 0x02,
+ FINALIZER_INTERRUPT_MASK = 0x04,
+ TRAP_INTERRUPT_MASK = 0x08
+};
+
+#define RUBY_VM_SET_TIMER_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, TIMER_INTERRUPT_MASK)
+#define RUBY_VM_SET_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, ASYNC_ERRINFO_INTERRUPT_MASK)
+#define RUBY_VM_SET_FINALIZER_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, FINALIZER_INTERRUPT_MASK)
+#define RUBY_VM_SET_TRAP_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, TRAP_INTERRUPT_MASK)
+#define RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & ~(th)->interrupt_mask & (ASYNC_ERRINFO_INTERRUPT_MASK|TRAP_INTERRUPT_MASK))
#define RUBY_VM_INTERRUPTED_ANY(th) ((th)->interrupt_flag & ~(th)->interrupt_mask)
int rb_signal_buff_size(void);