int Ns_TimedWaitForEvent( Ns_Event * event, Ns_Mutex * lock, int usec );
Ns_LockMutex(&lock); if (!ready) { result = Ns_TimedWaitForEvent(&ev, &lock, 10); if (result == NS_TIMEOUT) { ... handle timeout ... } else if (result != NS_OK) { ... handle error ... } } Ns_UnlockMutex(&lock);