PRINTF("Thread in slot %d returned %d\n", i, slot->rv);
PRINTF("selfserv: Thread in slot %d returned %d\n", i, slot->rv);
reap_threads(void){    perThread * slot;    int         i;    if (!threadLock)    	return 0;    PR_Lock(threadLock);    while (numRunning > 0) {    	PR_WaitCondVar(threadEndQ, PR_INTERVAL_NO_TIMEOUT);	for (i = 0; i < numUsed; ++i) {	    slot = threads + i;	    if (slot->running == rs_zombie)  {		/* Handle cleanup of thread here. */		PRINTF("Thread in slot %d returned %d\n", i, slot->rv);		/* Now make sure the thread has ended OK. */		PR_JoinThread(slot->prThread);		slot->running = rs_idle;		--numRunning;		/* notify the thread launcher. */		PR_NotifyCondVar(threadStartQ);	    }	}    }    /* Safety Sam sez: make sure count is right. */    for (i = 0; i < numUsed; ++i) {	slot = threads + i;    	if (slot->running != rs_idle)  {	    FPRINTF(stderr, "Thread in slot %d is in state %d!\n", 	            i, slot->running);    	}    }    PR_Unlock(threadLock);    FLUSH;    return 0;}