[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_TimedWaitForEvent

Overview

Wait for an event for a specified time

Syntax

    int Ns_TimedWaitForEvent(
    Ns_Event * event, 
    Ns_Mutex * lock, 
    int usec
    );

Description

Same as Ns_WaitForEvent except that it has a timeout in seconds. On timeout, the function returns NS_TIMEOUT.

Examples

    	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);
    			

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1998-99 America Online, Inc.