GDSX Manual
Service Routines
Extended General Device Support (GDSX) Manual–134303
8-28
GET^CPSEM
Except for the following consideration, the syntax, condition code settings, and
considerations regarding this procedure are the same as the counterpart in the Guardian
Procedure Calls Reference Manual.
Consideration
The ^FNAMEEXPAND procedure is defined as VARIABLE, which allows you to call it
with only the external-filename and internal-filename parameters. In
this case, GDSX submits the call with these two parameters to the Guardian
FNAMEEXPAND procedure, supplying FNAMEEXPAND with the default volume and
subvolume (from which the GDSX process was started), which is stored in a TSCODE
global variable.
If USCODE submits its own default volume and subvolume parameter to
^FNAMEEXPAND, then GDSX passes this to Guardian FNAMEEXPAND instead of
the default volume and subvolume name stored in the TSCODE global variable.
GET^CPSEM
This procedure allows a task to acquire the checkpoint semaphore maintained internally
by TSCODE in order to checkpoint data. Once the checkpoint semaphore is obtained,
the task can call Q^CP[X] to queue data in TSCODE’s checkpoint buffer, and then call
DO^CP or ^CHECKPOINT to actually copy the data to the backup process.
There is only one checkpoint semaphore, so a task obtaining this semaphore is
guaranteed that no other task (system or user task) can initiate a checkpoint operation
until the semaphore is released by means of GIVE^CPSEM. Therefore, the data that is
queued by a call to Q^CP[X] cannot be corrupted by another task.
If a task attempts to get the checkpoint semaphore when it is held by another task, the
task calling GET^CPSEM is suspended and put on a wait queue. (See “INIT^SEM” on
page 8-38 for an explanation of the queuing mechanism.) After acquiring the
semaphore the task may call Q^CP[X].
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] procedure.
status returned value
INT:value
indicates the outcome of the call. The value of status is one of the following:
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