Esempio n. 1
0
int
Ns_InitializeEvent(Ns_Event *event)
{
    Ns_CondInit((Ns_Cond *) event);

    return NS_OK;
}
Esempio n. 2
0
void
Ns_SemaInit(Ns_Sema *semaPtr, int count)
{
    static unsigned int nextid = 0;
    Sema *sPtr;

    sPtr = ns_malloc(sizeof(Sema));
    sPtr->count = count;
    NsMutexInitNext(&sPtr->lock, "sm", &nextid);
    Ns_CondInit(&sPtr->cond);
    *semaPtr = (Ns_Sema) sPtr;
}
Esempio n. 3
0
static pthread_cond_t *
GetCond(Ns_Cond *cond)
{
    if (*cond == NULL) {
    	Ns_MasterLock();
    	if (*cond == NULL) {
	    Ns_CondInit(cond);
    	}
    	Ns_MasterUnlock();
    }
    return (pthread_cond_t *) *cond;
}