On 08.05.23 04:38, 盏一 wrote:
> It seems extremely specific to one particular C++ implementation
To perform a force unwind during longjmp, the _Unwind_ForcedUnwind
function is used. This function is defined in the [Itanium C++ ABI
Standard](https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html#base-throw), which is followed by all C++ implementations. Additionally, the glibc [nptl/unwind.c](https://elixir.bootlin.com/glibc/latest/source/nptl/unwind.c#L130) file shows that on all platforms, pthread_exit is also implemented using _Unwind_ForcedUnwind.
Furthermore, the Itanium C++ ABI specification also defines
_Unwind_RaiseException as the entry point for all C++ exceptions thrown.
I ran your patch through Cirrus CI, and it passed on Linux but failed on
FreeBSD, macOS, and Windows. You should fix that if you want to
alleviate the concerns about the portability of this approach.