PREV UP NEXT StackThreads/MP: version 0.77 User's Guide

3.10: Callback

        ST_CALLBACK_BEGIN();
@        ST_CALLBACK_END();

These two procedures together declare that the surrounding procedure may be called from a sequential procedure (a procedure that is compiled by plain gcc). When a procedure f is called from a sequential procedure, ST_CALLBACK_BEGIN() must be placed in the top of f's variable declaration (ST_CALLBACK_BEGIN() is a macro that is expanded into a variable declaration). ST_CALLBACK_END() must be placed immediately before returning from f. More precisely, f must execute ST_CALLBACK_BEGIN() before any sub-procedure call in f and ST_CALLBACK_END() after any sub-procedure call in f. ST_CALLBACK_END() may syntactically appear twice or more (unless only one of them is executed at runtime). See Sequential Modules for more about this topic.