* win32_threads.c [GC_PTHREADS] (GC_pthread_detach): Repeat
GC_lookup_pthread() (with a 10 msec delay) while t is null; add comment
and TODO; remove ABORT if t is null (as t is never null after
pthread_detach call).
DCL_LOCK_STATE;
GC_ASSERT(!GC_win32_dll_threads);
- t = GC_lookup_pthread(thread);
+ /* The thread might not have registered itself yet. */
+ /* TODO: Wait for registration of the created thread in pthread_create. */
+ while ((t = GC_lookup_pthread(thread)) == NULL)
+ Sleep(10);
result = pthread_detach(thread);
if (result == 0) {
- if (NULL == t) ABORT("Thread not registered");
LOCK();
t -> flags |= DETACHED;
/* Here the pthread thread id may have been recycled. */