Cooperative multithreading via setjmp and longjmp has been around in C since the 80s at least.
I’m not sure this is so much hacking as an accepted technique from the old-old days which has somewhat fallen out of favour, especially as C is falling a little outside of the mainstream these days.
Perhaps it’s almost becoming lost knowledge :)
replies(1):