David Abrahams wrote:
Well, how do you propagate the cancellation to 'C'? Surely not by letting the C++ exception leak out into C-land, except on very special systems where the C runtime knows about EH. In that case, you have to finalize the exception and frob some 'C' cancellation reporting mechanism.
Very special systems? The C binding for POSIX threads *requires* a stack unwinding mechanism. In a pure C environment, it can be implemented by maintaining a runtime stack of registered cleanup routines. In a mixed-language environment, the solution is to implement a common EH framework in the platform's ABI.
I was assuming the participants on this list were taking the existence of such a common EH framework for granted. In such an environment, one should expect cancellation exceptions (and, perhaps, other exceptions too) thrown from code written in C++ to leak into C-land, and have compatible behaviour.
- Wil