Tcl API Reference -- ns_cond

### ns_cond

#### Overview

Manage events

#### Syntax

ns_cond broadcast eventid

ns_cond create

ns_cond destroy eventid

ns_cond set eventid

ns_cond wait eventid lockid ?timeout?

#### Description

Note that this function is the same as the ns_event function, except that ns_cond has a more efficient underlying implementation.

ns_cond broadcast wakes up all threads waiting on the specified event. The eventid argument is the event ID returned by ns_cond create when the event was created.

ns_cond create initializes an event and returns an event ID for the new event.

ns_cond destroy frees the resources associated with the specified event. The eventid argument is the event ID returned by ns_cond create when the event was created.

ns_cond set wakes up the specified event. The eventid argument is the event ID returned by ns_cond create when the event was created.

ns_cond wait waits for the specified event for a specified time. The eventid argument is the event ID returned by ns_cond create when the event was created. The lockid argument is the id of a mutex lock. The timeout argument is the time to wait in seconds. The return value is 0 (zero) if the event timed out and 1(one) if the event was woken up.

#### See Also

Ns_InitializeEvent

Ns_BroadcastEvent

Ns_DestroyEvent

Ns_SetEvent

Ns_WaitForEvent

Ns_TimedWaitForEvent

Top of Page
Copyright © 1998-99 America Online, Inc.