summaryrefslogtreecommitdiffstats
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
commit769ff25033ff891e1487dfc7b714f0daa6ebdf65 (patch)
tree966dc305bfddb1b740f825806de4720d8e720825 /thread_win32.ci
parenta4e9109c72bf0b7201b29df242b03c061928fbc3 (diff)
downloadruby-769ff25033ff891e1487dfc7b714f0daa6ebdf65.tar.gz
ruby-769ff25033ff891e1487dfc7b714f0daa6ebdf65.tar.xz
ruby-769ff25033ff891e1487dfc7b714f0daa6ebdf65.zip
* thread.c (is_ruby_native_thread): check properly. [ruby-dev:31166]
git-svn-id: http://svn.ruby-lang.org/repos/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 bfb7f681c..3bdb2e427 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(),