summaryrefslogtreecommitdiff
path: root/rubysig.h
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-11 07:37:02 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-11 07:37:02 +0000
commit314734add8ad699b1de13c3382e79dca6cca903a (patch)
tree22c673257e8e7ace82deaabac5780843da8598fb /rubysig.h
parent20e961458e9f34504dc07712ad6b0e8aa1d165f8 (diff)
* win32/win32.[ch] (rb_w32_enter_critical, rb_w32_leave_critical): no
need to reject reentrance. removed. * rubysig.h (RUBY_CRITICAL): follow above changes. * rubysig.h (TRAP_BEG, TRAP_END): no need to save errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rubysig.h')
-rw-r--r--rubysig.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/rubysig.h b/rubysig.h
index ca68e64206a..2df03e415c1 100644
--- a/rubysig.h
+++ b/rubysig.h
@@ -24,19 +24,16 @@ typedef LONG rb_atomic_t;
/* Windows doesn't allow interrupt while system calls */
# 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;\
- errno = saved_errno;\
} while (0)
# define RUBY_CRITICAL(statements) do {\
- rb_w32_enter_critical();\
+ rb_atomic_t trap_immediate = ATOMIC_SET(rb_trap_immediate, 0);\
statements;\
- rb_w32_leave_critical();\
+ ATOMIC_SET(rb_trap_immediate, trap_immediate);\
} while (0)
#else
typedef int rb_atomic_t;
@@ -47,14 +44,11 @@ typedef int rb_atomic_t;
# define ATOMIC_DEC(var) (--(var))
# define TRAP_BEG do {\
- int saved_errno = 0;\
int trap_immediate = rb_trap_immediate;\
rb_trap_immediate = 1
# define TRAP_END \
rb_trap_immediate = trap_immediate;\
- saved_errno = errno;\
- errno = saved_errno;\
} while (0)
# define RUBY_CRITICAL(statements) do {\