Most C++ implementations throw their hands up at setjmp/longjmp/setcontext/makecontext.
Even if it appears to work, it's a dangerous set of routines to use in C++.
Even if it appears to work, it's a dangerous set of routines to use in C++.
Also, a little rootling around on the web reveals the following statement in IBM's z/OS docs:
"Do not issue getcontext() in a C++ constructor or destructor, since the saved context would not be usable in a subsequent setcontext() or swapcontext() after the constructor or destructor returns."