From 6fc746d7e32243b4c46ac5ef9fee4806664fd7e6 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 18 Aug 2007 08:40:13 +0000 Subject: * 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 --- thread_win32.ci | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'thread_win32.ci') 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(), -- cgit v1.2.3