mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Make better use of GNU Pth -- patch by Andy Dustman.
I can't test this, so I'm just checking it in with blind faith in Andy. I've tested that it doesn't broeak a non-Pth build on Linux. Changes include: - There's a --with-pth configure option. - Instead of _GNU_PTH, we test for HAVE_PTH. - Better signal handling. - (The config.h.in file is regenerated in a slightly different order.)
This commit is contained in:
parent
0344424793
commit
9e8181b809
7 changed files with 521 additions and 558 deletions
|
@ -62,6 +62,9 @@
|
|||
handler ignores signals if getpid() isn't the same as in the main
|
||||
thread. XXX This is a hack.
|
||||
|
||||
GNU pth is a user-space threading library, and as such, all threads
|
||||
run within the same process. In this case, if the currently running
|
||||
thread is not the main_thread, send the signal to the main_thread.
|
||||
*/
|
||||
|
||||
#ifdef WITH_THREAD
|
||||
|
@ -109,6 +112,12 @@ static void
|
|||
signal_handler(int sig_num)
|
||||
{
|
||||
#ifdef WITH_THREAD
|
||||
#ifdef WITH_PTH
|
||||
if (PyThread_get_thread_ident() != main_thread) {
|
||||
pth_raise(*(pth_t *) main_thread, sig_num);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
/* See NOTES section above */
|
||||
if (getpid() == main_pid) {
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue