EC2_$INIT Domain/OS EC2_$INIT
NAME
ec2_$init - initialize an eventcount
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/ec2.h>
void ec2_$init(ec2_$eventcount_t *eventcount)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/ec2.ins.pas';
procedure ec2_$init(out eventcount: ec2_$eventcount_t);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/ec2.ins.ftn'
integer*4 value
integer*2 eventcount(3)
equivalence (value, eventcount(1))
call ec2_$init(eventcount)
DESCRIPTION
Ec2_$init initializes a user-defined eventcount. An initialized user-
defined eventcount must be mapped into the address space of all processes
using the eventcount. The eventcount may be in the same object with
other data shared by the processes using the eventcount.
This is the usual way to initialize an eventcount:
1. Map a file large enough to hold an eventcount with an exclusive
write lock to ensure that the map will fail if another process
simultaneously attempts to initialize the same eventcount by
mapping the file the same way.
2. Call ec2_$init to initialize the eventcount and register it
with the system.
3. Remap or relock the lock record object so that other processes
can map it for shared write access.
eventcount
The eventcount to initialize.
NOTES
A program should not attempt to initialize a system eventcount with
ec2_$init. System eventcounts are initialized by the system, and
attempts by user processes to initialize them will lead to unexpected
results.
SEE ALSO
ms_$crmapl, ms_$relock, and ms_$remap.