* pthread_support.c (WRAP_FUNC(pthread_join)): Remove assertion that
thread is finished; call GC_delete_gc_thread only if thread is
finished; add comment.
* win32_threads.c [GC_PTHREADS] (GC_pthread_join): Call
GC_delete_gc_thread_no_free and GC_INTERNAL_FREE only if thread is
finished.
# endif
if (result == 0) {
LOCK();
- /* Here the pthread thread id may have been recycled. */
- GC_ASSERT((t -> flags & FINISHED) != 0);
- GC_delete_gc_thread(t);
+ /* Here the pthread thread id may have been recycled. */
+ /* Delete the thread from GC_threads (unless it has been */
+ /* registered again from the client thread key destructor). */
+ if ((t -> flags & FINISHED) != 0)
+ GC_delete_gc_thread(t);
UNLOCK();
}
return result;
# endif
LOCK();
+ if ((t -> flags & FINISHED) != 0) {
GC_delete_gc_thread_no_free(t);
GC_INTERNAL_FREE(t);
+ }
UNLOCK();
}