|   | ![[ Previous ]](navbprev.gif)  ![[ Contents ]](navbhome.gif)  ![[ Index ]](navbhelp.gif)  ![[ Next ]](navbnext.gif)  | 
    int Ns_BroadcastEvent(
    Ns_Event * event
    );
Wake up all the threads waiting on the event. If no threads are waiting on the event, this function has no effect.
    static Ns_Event myev;
    static Ns_Mutex mylock;
    
    void
    Init(void)
    {
    	/* Initialize the lock and event at startup. */
    	Ns_InitializeMutex(&mylock);
    	Ns_InitializeEvent(&myev);
    }
    
    /* Lock the mutex and wait for the event. */
    void
    WaitFunc(void)
    {
    	Ns_LockMutex(&mylock);
    	Ns_WaitForEvent(&myev, &mylock);
    }
    
    /* Wake up any waiting threads. */
    void
    BroadcastFunc(void)
    {
    	Ns_BroadcastEvent(&myev);
    }