Continuation passing style by spawning a new thread with the continuation function. Wow. I remember trying to wrap my head around how Erlang implemented infinite loops with recursion (tail recursion with a trampoline I guess?) but never would have guessed it could be done in C by spawning a thread.