NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_event(n) 5.0.0a naviserver "NaviServer Built-in Commands"

Name

ns_event - Manage events

Table Of Contents

Synopsis

Description

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

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

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

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

ns_event wait waits for the specified event for a specified time. The eventid argument is the event ID returned by ns_event 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.

COMMANDS

ns_event broadcast eventid
ns_event create
ns_event destroy eventid
ns_event set eventid
ns_event wait eventid lockid ?timeout?

EXAMPLES


Keywords

event, mutex, server built-in, thread