EC2_$WAIT Domain/OS EC2_$WAIT
NAME
ec2_$wait - wait for an eventcount trigger
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/ec2.h>
pinteger ec2_$wait(
ec2_$ptr_t *ec_plist,
long *ec_vlist,
short &ec_count,
status_$t *status)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/ec2.ins.pas';
function ec2_$wait(
in ec_plist: univ ec2_$ptr_list_t;
in ec_vlist: univ ec2_$val_list_t;
ec_count: integer;
out status: status_$t): pinteger;
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/ec2.ins.ftn'
integer*4 ec_plist(128), ec_vlist(128), status
integer*2 ec_satisfied, ec_count
ec_satisfied = ec2_$wait(ec_plist, ec_vlist, ec_count, status)
DESCRIPTION
Ec2_$wait waits until one of the eventcounts in the ec_plist reaches its
trigger value in the ec_vlist. When an eventcount reaches its trigger
value, ec2_$wait returns the position in ec_plist of the pointer to the
eventcount that is satisfied. If the first eventcount in ec_plist is
satisfied, ec2_$wait returns 1; if the last eventcount is satisfied,
ec2_$wait returns ec_count.
Several eventcounts may have been satisfied by the time this call
returns. The value returned is the position of the eventcount with the
smallest subscript that is satisfied.
ec_plist
An array of pointers to eventcounts. The total number of pointers
in ec_plist on any one node cannot exceed 128. The pointers in
ec_plist for system eventcounts are returned by the get_ec calls for
the manager of the eventcounts.
ec_vlist
An array of positive trigger values for each of the eventcounts in
ec_plist. Ec2_$wait returns when any of the eventcounts from
ec_plist reaches its trigger value in ec_vlist.
ec_count
Number of eventcount pointers in ec_plist.
status
The completion status.
NOTES
The difference between ec2_$wait and ec2_$wait_svc or ec2_$wait_slow_io
is in how they respond to asynchronous faults. Ec2_$wait only returns
when an eventcount advances; it never returns due to an asynchronous
fault. If the calling process has disabled asynchronous faults,
ec2_$wait just ignores any asynchronous faults received. If asynchronous
faults are enabled and one is received during a call to ec2_$wait, then
ec2_$wait responds in the following way:
⊕ It calls the clean-up handler, if the calling process has one.
⊕ If the calling process lacks a clean-up handler but has a fault
handler, then ec2_$wait calls the fault handler. If the fault
handler returns, ec2_$wait resumes and continues waiting.
⊕ If the calling process has neither a clean-up handler nor a fault
handler, the system aborts the calling process.
SEE ALSO
gpr_$get_ec, ios_$get_ec, ipc_$get_ec, mbx_$get_ec, pbu_$get_ec,
pfm_$enable, pfm_$inhibit, pgm_$get_ec, time_$get_ec.