rem: Thread *thrPtr, *thisPtr; static int state;
add: Thread *thrPtr;
context: NewThread(Ns_ThreadProc *proc, void *arg, long stacksize, int flags,    	   Thread *parentPtr){    Thread *thrPtr, *thisPtr;    static int state;    thrPtr = calloc(1, sizeof(Thread));    if (thrPtr == NULL) {	NsThreadFatal("NsNewThread", "calloc", ENOMEM);    }    thrPtr->ctime = time(NULL);    thrPtr->proc = proc;    thrPtr->arg = arg;    thrPtr->stackSize = stacksize;    thrPtr->flags = flags;    if (parentPtr != NULL) {    	strcpy(thrPtr->parent, parentPtr->name);    }    if (state != 0) {	Ns_MutexLock(&lock);    }    thrPtr->nextPtr = firstPtr;    firstPtr = thrPtr;    if (state == 0) {	++state;    } else {	if (state == 1) {	    Ns_MutexSetName2(&lock, "nsthread", "new");	    ++state;	}	Ns_MutexUnlock(&lock);    }    return thrPtr;}