- if (that_thread->thread_func)
- pthread_join (that_thread->tid, NULL);
-
+ ret = pthread_join (that_thread->tid, NULL);
+ if (ret == EDEADLK)
+ CtdlLogPrintf(CTDL_DEBUG, "Garbage collection on own thread.\n");
+ else if (ret == EINVAL)
+ CtdlLogPrintf(CTDL_DEBUG, "Garbage collection, that thread already joined on.\n");
+ else if (ret == ESRCH)
+ CtdlLogPrintf(CTDL_DEBUG, "Garbage collection, no thread to join on.\n");
+ else if (ret != 0)
+ CtdlLogPrintf(CTDL_DEBUG, "Garbage collection, pthread_join returned an unknown error.\n");