Cookbook Chapter 4: Proving Thread Safety.
This example demonstrates that infix trampoline handles are thread-safe. A trampoline handle (infix_forward_t* or infix_reverse_t*) is immutable after creation and can be safely shared between threads. All mutable state (like error details) is stored in thread-local storage, so calls from different threads will not interfere with each other.
This recipe creates a trampoline on the main thread and passes its callable function pointer to a worker thread, which then executes the FFI call.