Cookbook Chapter 4: Proving Reentrancy with Nested FFI Calls.
This test demonstrates that infix is fully reentrant, meaning it is safe to make an infix FFI call from within a handler that was invoked by another infix FFI call.
The call chain is:
- C
main function (Forward Call) -> harness function
harness function (Native Call) -> infix Reverse Callback
- Reverse Callback Handler (Forward Call) ->
multiply function
This works because infix uses no global mutable state; all context is either passed directly or stored in thread-local storage.