* win32_threads.c (GC_register_my_thread): Fix SEGV by setting "me"
to the newly-created thread GC descriptor (if lookup failed) before
altering flags of "me" (only if GC_PTHREADS); add comment (same as
in pthread_support.c).
LOCK();
me = GC_lookup_thread_inner(thread_id);
if (me == 0) {
- GC_register_my_thread_inner(sb, thread_id);
# ifdef GC_PTHREADS
+ me = GC_register_my_thread_inner(sb, thread_id);
me -> flags |= DETACHED;
+ /* Treat as detached, since we do not need to worry about */
+ /* pointer results. */
+# else
+ GC_register_my_thread_inner(sb, thread_id);
# endif
UNLOCK();
return GC_SUCCESS;