[issue42969] pthread_exit & PyThread_exit_thread are harmful

Gregory P. Smith report at bugs.python.org
Tue Jan 19 14:58:22 EST 2021


Gregory P. Smith <greg at krypto.org> added the comment:

C-APIs such as `PyEval_RestoreThreads()` are insufficient for the task they are asked to do.  They return void, yet have a failure mode.

They call pthread_exit() on failure today.

Instead, they need to return an error to the calling application to indicate that "The Python runtime is no longer available."

Callers need to act on that in whatever way is most appropriate to them.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42969>
_______________________________________


More information about the Python-bugs-list mailing list