gh-103092: Isolate _tkinter (WIP) by erlend-aasland · Pull Request #103108 · python/cpython
There's no way to pass state to PyOS_InputHooks. Introduce a new hook with context pointer?
We can add two private API functions (a name and arguments are up to discussion):
int _PyOS_suscribesig(int i, void(*)(int, void *) h, void *harg);void _PyOS_unsuscribesig(int subscription);
and reimplement PyOS_setsig as a wrapper to avoid conflicts.
By the way, are the signals are process-wide or pthread-wide? If the former, is there a global CPython structure common for all (sub)interpreters?