Go to the first, previous, next, last section, table of contents.


Function: ]invokeHandler { [args] handler -> [args] }
file: job.t
package: muf
status: alpha

This function is used internally by ]signal and kin to invoke a handler. It is not normally called directly by the application programmer. The handler argument specifies the handler to invoke. This argument is not a pointer to the handler proper, but rather a handler ID as returned by |getAllActiveHandlers[.

The reason we use ]invokeHandler to invoke a handler function, rather than just calling it directly, is that ]invokeHandler pushes a HANDLING stackframe and then calls the handler, all in one atomic operation, guaranteeing that the handler set cannot possibly be handling more than one signal at a time. This guarantee is required by the CommonLisp standard because it prevents nasty bugs and coding headaches which could otherwise occur.

Before calling the indicated handler, ]invokeHandler switches to the actingUser which was in effect at the time the handler binding was established. (This is intended to avoid odd and difficult-to-trace problems due to a signal arriving when some unexpected actingUser is in effect.) A JOB_STACKFRAME_TMP_USER stackframe is pushed before making the call, which will result in the pre-]invokeHandler actingUser being restored upon (any kind of) exit from the handler. See section `JOB_STACKFRAME_TMP_USER' in Muq Source Code.

Go to the first, previous, next, last section, table of contents.