int Ns_WaitForEvent( Ns_Event * event, Ns_Mutex * lock );
static int ready = 0; static Ns_Event ev; static Ns_Mutex lock; void Init(void) { Ns_InitializeMutex(&lock); Ns_InitializeEvent(&ev); } void Waiter(void) { Ns_LockMutex(&lock); if (!ready) { Ns_WaitForEvent(&ev, &lock); } Ns_UnlockMutex(&lock); ... resource ready ... }