#include <exec/chExec.h>int svActorAbortHandlerConnect(KnCap * actorcap, int vectindex, KnLapDesc * newhandler);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The svActorAbortHandler() calls are used to manage abort handlers associated with the actor whose capability is pointed to by actorcap . These calls are restricted to SUPERVISOR threads.
The svActorAbortHandlerConnect() function duplicates the LAP descriptor pointed to by newhandler into the specified entry of the abort handler's vector.
The svActorAbortHandlerDisconnect function clears the LAP descriptor stored in the specified entry of the abort handler's vector. If curhandler is not equal to K_CONNECTED_LAP , it must point to a LAP descriptor identical to the LAP descriptor currently installed.
The svActorAbortHandlerGetConnected() function copies the lap descriptor currently installed in the abort handler's vector at the location pointed to by curhandler .
Abort handlers are specified in the form of LAP descriptors (see svLapCreate(2K) ).
As several subsystem managers may need to control the aborted state of a thread, the microkernel keeps a vector of K_ACTOR_ABORTVECT_MAX abort handlers per actor.
The vectindex parameter identifies which entry of the abort handlers vector should be used by the calls. The consistent allocation of vector indexes among subsystem managers is the responsibility of the subsystem managers. Depending on the subsystems, the last vector entry may be reserved for use by the application. For that purpose, the constant K_ACTOR_ABORTVECT_LAST can be used independently of the system configuration to designate the index K_ACTOR_ABORTVECT_MAX - 1 .
When a thread returns from executing within its home actor environment while in the ABORTED state, the system invokes all abort handlers which have been associated with the thread's home actor (see lapInvoke(2K) ). The system clears the thread ABORTED state before calling the handlers (just as if threadAborted(2K_I) were called). Abort handlers are invoked in sequence, starting from index 0, until one of them succeeds in processing the abort event (sets the status to K_ABORT_COMPLETED ).
KnAbortStatus *abortStatus ; KnThreadCtx *threadCtx ;
The abortStatus field can be used by the abort handler to indicate that the abort has been successfully processed. The abort handler is called with abortStatus pointing to a status variable set to K_ABORT_INPROGRESS . The handler indicates that it has completed the abort processing by setting this status variable to K_ABORT_COMPLETED . In this case no other abort handlers are invoked.
The threadCtx field gives access to the register context of the aborted thread. This context is processor-dependent. Abort handlers can modify the register context of the aborted thread to recover from the abort.
On success, the calls return K_OK . Otherwise a negative error code is returned.
svActorAbortHandlerConnect() is called and there is already a valid LAP descriptor installed in the specified entry of the abort handler's vector.
actorcap is an inconsistent actor capability or vectindex is invalid. The curhandler LAP descriptor specified to svActorAbortHandlerDisconnect is not equal to K_CONNECTED_LAP and does not match the LAP descriptor currently installed.
actorcap does not specify a local actor.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|