summaryrefslogtreecommitdiff
path: root/rubysig.h
diff options
context:
space:
mode:
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 {\