summaryrefslogtreecommitdiff
path: root/thread_win32.ci
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-18 08:40:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-18 08:40:13 +0000
commit6fc746d7e32243b4c46ac5ef9fee4806664fd7e6 (patch)
tree966dc305bfddb1b740f825806de4720d8e720825 /thread_win32.ci
parent2c5ae0eebad1397653f5dac5982cd5eba14ff35d (diff)
* thread.c (is_ruby_native_thread): check properly. [ruby-dev:31166]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.ci')
-rw-r--r--thread_win32.ci18
1 files changed, 17 insertions, 1 deletions
diff --git a/thread_win32.ci b/thread_win32.ci
index bfb7f681c7..3bdb2e4276 100644
--- a/thread_win32.ci
+++ b/thread_win32.ci
@@ -20,10 +20,26 @@
#define native_thread_yield() Sleep(0)
#define remove_signal_thread_list(th)
+static volatile DWORD ruby_native_thread_key = TLS_OUT_OF_INDEXES;
+
+static rb_thread_t *
+ruby_thread_from_native(void)
+{
+ return TlsGetValue(ruby_native_thread_key);
+}
+
+static int
+ruby_thread_set_native(rb_thread_t *th)
+{
+ return TlsSetValue(ruby_native_thread_key, th);
+}
+
static void
-Init_native_thread()
+Init_native_thread(void)
{
rb_thread_t *th = GET_THREAD();
+
+ ruby_native_thread_key = TlsAlloc();
DuplicateHandle(GetCurrentProcess(),
GetCurrentThread(),
GetCurrentProcess(),