GDSX Manual

Service Routines
Extended General Device Support (GDSX) Manual134303
8-54
PROCESS_STOP_
PROCESS_STOP_
This procedure allows USCODE to stop a process it has created and send a process
deletion system message to the mom of the process and to any other process that is
entitled to receive the message. This procedure allows TSCODE to clean up the GDSX
internal process control block (PCB) before stopping the process. This procedure is a
waited operation.
If USCODE is unconverted, the USCODE tasks cannot call this procedure. If a task
within an unconverted application calls this procedure, file-system error 29 or 560 is
returned. Unconverted USCODE calls the Guardian STOP procedure (not a pseudo
Guardian procedure) to stop a low PIN process by passing the process ID of that
process.
Except for the following consideration, the syntax, condition code settings, and
considerations regarding this procedure are the same as given for the Guardian
procedure in the Guardian Procedure Calls Reference Manual.
Consideration
The PROCESS_STOP_ procedure prohibits an attempt by USCODE to stop the GDSX
process within which the task is running.
PSEM
The PSEM procedure acquires a semaphore associated with a shared resource. PSEM is
not used to acquire a checkpoint semaphore. The checkpoint semaphore is acquired
with the GET^CPSEM procedure.
status returned value
INT:value
indicates the outcome of the call. The value of status is one of the following:
Caution. Tasks may own multiple semaphores simultaneously; however, GDSX provides no
deadlock detection or resolution mechanism. Do not attempt to obtain a semaphore that you
already own. Doing this causes your task to wait forever for the owner to give it up. To avoid
this, you can compare the first element of the semaphore with the address of your TCB. If they
match, you own the semaphore.
Caution. A task is in an unstoppable state while it owns one or more semaphores. If the task
faults while in an unstoppable state, the primary GDSX process stops.
status := PSEM ( semaphore !
i
,[ time ] ); !
i
0 There was a timeout before the semaphore was obtained
1 The semaphore was obtained