summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog9
-rw-r--r--rubysig.h10
-rw-r--r--version.h6
-rw-r--r--win32/win32.c50
-rw-r--r--win32/win32.h2
5 files changed, 14 insertions, 63 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c80de2264b..faf7133e92c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Wed Apr 11 16:35:16 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * 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.
+
Tue Apr 10 17:02:17 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_fclose, rb_w32_close): need to save errno
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 {\
diff --git a/version.h b/version.h
index db0b9696191..0abf460c932 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-04-10"
+#define RUBY_RELEASE_DATE "2007-04-11"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20070410
+#define RUBY_RELEASE_CODE 20070411
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 4
-#define RUBY_RELEASE_DAY 10
+#define RUBY_RELEASE_DAY 11
RUBY_EXTERN const char ruby_version[];
RUBY_EXTERN const char ruby_release_date[];
diff --git a/win32/win32.c b/win32/win32.c
index 8d1f3e483fb..1b878c450ea 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3627,56 +3627,6 @@ rb_w32_times(struct tms *tmbuf)
#define yield_once() Sleep(0)
#define yield_until(condition) do yield_once(); while (!(condition))
-static CRITICAL_SECTION *
-system_state(void)
-{
- static int initialized = 0;
- static CRITICAL_SECTION syssect;
-
- if (!initialized) {
- InitializeCriticalSection(&syssect);
- initialized = 1;
- }
- return &syssect;
-}
-
-static LONG flag_interrupt = -1;
-static volatile DWORD tlsi_interrupt = TLS_OUT_OF_INDEXES;
-
-void
-rb_w32_enter_critical(void)
-{
- if (IsWinNT()) {
- EnterCriticalSection(system_state());
- return;
- }
-
- if (tlsi_interrupt == TLS_OUT_OF_INDEXES) {
- tlsi_interrupt = TlsAlloc();
- }
-
- {
- DWORD ti = (DWORD)TlsGetValue(tlsi_interrupt);
- while (InterlockedIncrement(&flag_interrupt) > 0 && !ti) {
- InterlockedDecrement(&flag_interrupt);
- Sleep(1);
- }
- TlsSetValue(tlsi_interrupt, (PVOID)++ti);
- }
-}
-
-void
-rb_w32_leave_critical(void)
-{
- if (IsWinNT()) {
- LeaveCriticalSection(system_state());
- return;
- }
-
- InterlockedDecrement(&flag_interrupt);
- TlsSetValue(tlsi_interrupt, (PVOID)((DWORD)TlsGetValue(tlsi_interrupt) - 1));
-}
-
struct handler_arg_t {
void (*handler)(int);
int arg;
diff --git a/win32/win32.h b/win32/win32.h
index de8f55d8e3c..281dbc2998c 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -508,8 +508,6 @@ int rb_w32_times(struct tms *);
/* thread stuff */
HANDLE GetCurrentThreadHandle(void);
int rb_w32_sleep(unsigned long msec);
-void rb_w32_enter_critical(void);
-void rb_w32_leave_critical(void);
int rb_w32_putc(int, FILE*);
int rb_w32_getc(FILE*);
int rb_w32_close(int);