GDSX (Extended General Device Support) Manual
Service Routines
Extended General Device Support (GDSX) Manual—529931-001
8-29
GET^CPSEM
Global data may be checkpointed concurrently with the task’s stack image and
memory pool buffers. See the example in the description of the Q^CP[X] on
page 8-57.
status returned value
INT:value
indicates the outcome of the call. The value of status is one of the following:
Considerations
•
A task calling this procedure may be suspended.
•
The manner in which GET^CPSEM returns the values 0 or 1 is intended to allow
procedures that need to call Q^CP[X] to obtain the semaphore while still ensuring
that checkpointed information from related calls is sent to the backup in a single
I/O.
For example, procedures P1 and P2 both require checkpointing and P2 calls P1.
P1 is also called in other places. P1 might be coded as follows:
PROC P1;
BEGIN
INT P1^GOT^CP^SEM := GET^CPSEM;
.
.
CALL Q^CP(.....);
.
.
IF P1^GOT^CP^SEM THEN
BEGIN
CALL DO^CP;
CALL GIVE^CPSEM;
END;
END;
Similarly, P2 is:
PROC P2;
BEGIN
INT P2^GOT^CP^SEM := GET^CPSEM;
.
.
CALL Q^CP(.....);
Caution. While a task owns one or more semaphores, it is in an unstoppable state; if the task
faults while in this state, the primary GDSX process stops.
status := GET^CPSEM
0 The calling task owned the checkpoint semaphore before this call
1 The semaphore was acquired on this call