5 init_thread_intern(struct thread *thr)
8 static int key_allocated = 0;
9 DuplicateHandle(GetCurrentProcess(),
15 DUPLICATE_SAME_ACCESS);
17 if ((thr_key = TlsAlloc()) == TLS_OUT_OF_INDEXES)
18 croak("panic: TlsAlloc");
21 if (TlsSetValue(thr_key, (LPVOID) thr) != TRUE)
22 croak("panic: TlsSetValue");
28 Perl_thread_create(struct thread *thr, thread_func_t *fn)
32 MUTEX_LOCK(&thr->mutex);
33 thr->self = CreateThread(NULL, 0, fn, (void*)thr, 0, &junk);
34 MUTEX_UNLOCK(&thr->mutex);
35 return thr->self ? 0 : -1;