summaryrefslogtreecommitdiffstats
path: root/rubysig.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-31 15:02:22 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-31 15:02:22 +0000
commit4ef881bd15c9c4e2e9b20da2c091e80d4d530119 (patch)
tree7b725552a9a4ded93849ca2faab1b257f7761790 /rubysig.h
parent182520b0acc5eea4da52bc8734dc5e3280ce5f94 (diff)
downloadruby-4ef881bd15c9c4e2e9b20da2c091e80d4d530119.tar.gz
ruby-4ef881bd15c9c4e2e9b20da2c091e80d4d530119.tar.xz
ruby-4ef881bd15c9c4e2e9b20da2c091e80d4d530119.zip
* Merge YARV
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rubysig.h')
-rw-r--r--rubysig.h31
1 files changed, 5 insertions, 26 deletions
diff --git a/rubysig.h b/rubysig.h
index bce1c4f2a..ca68e6420 100644
--- a/rubysig.h
+++ b/rubysig.h
@@ -26,12 +26,13 @@ typedef LONG rb_atomic_t;
# define TRAP_BEG do {\
int saved_errno = 0;\
rb_atomic_t trap_immediate = ATOMIC_SET(rb_trap_immediate, 1)
+
# define TRAP_END\
ATOMIC_SET(rb_trap_immediate, trap_immediate);\
saved_errno = errno;\
- CHECK_INTS;\
errno = saved_errno;\
} while (0)
+
# define RUBY_CRITICAL(statements) do {\
rb_w32_enter_critical();\
statements;\
@@ -49,9 +50,10 @@ typedef int rb_atomic_t;
int saved_errno = 0;\
int trap_immediate = rb_trap_immediate;\
rb_trap_immediate = 1
-# define TRAP_END rb_trap_immediate = trap_immediate;\
+
+# define TRAP_END \
+ rb_trap_immediate = trap_immediate;\
saved_errno = errno;\
- CHECK_INTS;\
errno = saved_errno;\
} while (0)
@@ -68,7 +70,6 @@ RUBY_EXTERN int rb_prohibit_interrupt;
#define DEFER_INTS (rb_prohibit_interrupt++)
#define ALLOW_INTS do {\
rb_prohibit_interrupt--;\
- CHECK_INTS;\
} while (0)
#define ENABLE_INTS (rb_prohibit_interrupt--)
@@ -79,27 +80,5 @@ void rb_trap_restore_mask(void);
RUBY_EXTERN int rb_thread_critical;
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 || rb_thread_critical)) {\
- if (rb_thread_pending) rb_thread_schedule();\
- if (rb_trap_pending) rb_trap_exec();\
- }\
-} while (0)
-#else
-/* pseudo preemptive thread switching */
-RUBY_EXTERN int rb_thread_tick;
-#define THREAD_TICK 500
-#define CHECK_INTS do {\
- 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
#endif /* ifndef RUBYSIG_H */