Open System Testing Architecture

TOC PREV NEXT INDEX



WAIT FOR SEMAPHORE Command

Description:

This command halts the script until the specified semaphore is in its "Set" state. The semaphore is identified by its name and scope (which must be either "LOCAL" or "TEST-WIDE"). A test-wide semaphore is one that is shared by all scripts running as part of a distributed test; a local semaphore is only shared between scripts running on the local node.

By default, if the semaphore is in its "Clear" state when the WAIT FOR SEMAPHORE command is issued, the thread will be suspended until it is set into its "Set" state. However, if a time-out period is specified, this represents the maximum number of seconds that OpenSTA will wait for the semaphore to be set before timing out the request. A period of zero indicates that the request should be timed out immediately if the semaphore is not set.

The "ON TIMEOUT GOTO tmo_label" clause can be specified to define a label to which control should be transferred if the request times out. In addition, the "ON ERROR GOTO err_label" clause can be specified to define a label to which control should be transferred in the event of an error, or if the request times out and there was no "ON TIMEOUT GOTO tmo_label" clause.

Format:
 WAIT {period} FOR {scope} SEMAPHORE semaphore-name {&}
 	 {,ON TIMEOUT GOTO tmo_label} {&}
 	 {,ON ERROR GOTO err_label}
Parameters:
period

An integer variable or value defining the number of seconds to wait. The valid range is 0-2147483647.

scope

The scope of the semaphore to wait for. This must be either "LOCAL" or "TEST-WIDE", and defaults to "LOCAL".

semaphore-name

A character variable, or quoted character string, containing the name of the semaphore to wait for.

tmo_label

A label defined within the current scope of the script, to which control branches if a time-out occurs.

err_label

A label defined within the current scope of the script, to which control branches if an error occurs, or the command times out and "tmo_label" is not specified.

Example:
 WAIT 10 FOR SEMAPHORE "SERVER-RUNNING"

See also:

Input Stream Entry Commands


OpenSTA.org
Mailing Lists
Further enquiries
Documentation feedback
CYRANO.com
TOC PREV NEXT INDEX