Preprocessor macro expanding to a command
Space | User/kernel |
Context | Sync/async |
May block | No |
SPL | Any |
Dynamic memory | No |
#include <SPAD/AC.H>
CALL_AST(ast);
This is a preprocessor macro that expands to machine- and compiler-dependent code to call an AST. If current SPL is lower than AST's SPL, the AST function is executed immediatelly, otherwise the AST is queued. There is no way to cancel an AST — once queued, the AST
structure must be valid and unchanged until AST function is entered. The structure may be freed or modified in the AST function.
fn
pointing to AST function declared with DECL_AST.ASTs on the same SPL are called in the same order they were queued, but the programmer must not depend on it for correctness. The programmer may depend on this feature for good performance (for example networking packets are queued with this call — the protocols are required to handle out-of-order packets correctly, altough it causes performance degradation).