Application Tasks
K
A
DAK
45
Exit Procedures execute in the context of the task which issued the ajexit call. They are
therefore free to use all services normally available to tasks. For instance, an Exit
Procedure could use ajsenw to send a shutdown message to a task and wait for that task
to do its shutdown processing. When the Exit Procedure resumes after the ajsenw call, it
returns to AMX which then calls the next Exit Procedure in the list.
An Exit Procedure must not issue any AMX directives which would in any way terminate
task execution.
Exit Procedures use the stack of the task which called ajexit. It is therefore essential
that the task which calls ajexit be allocated sufficient stack to satisfy the worst case
requirements of all application Exit Procedures.
Note
Exit Procedures must only use AMX services which are
marked in Chapter 16 as
n Exit Procedure
Warning
If any Exit Procedure is coded using the Medium model,
the task which calls ajexit MUST also use the Medium
model.