diff options
author | Guido van Rossum <guido@python.org> | 1992-08-17 08:59:08 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-08-17 08:59:08 (GMT) |
commit | f9f2e82fcade2d44a69bbdac1ba59bdf591743f4 (patch) | |
tree | 0d9a0201382025d0a09e75cbdf37973a8b8cb32f /Python/pythonrun.c | |
parent | 0297512a08698cdee4bebe044a40b08b406398a8 (diff) | |
download | cpython-f9f2e82fcade2d44a69bbdac1ba59bdf591743f4.zip cpython-f9f2e82fcade2d44a69bbdac1ba59bdf591743f4.tar.gz cpython-f9f2e82fcade2d44a69bbdac1ba59bdf591743f4.tar.bz2 |
New thread.c from Sjoerd, supports _exit_prog(). Use this in goaway()
to avoid hanging in cleanup().
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 08d1dbe..5358ee5 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -361,6 +361,10 @@ fatal(msg) /* Clean up and exit */ +#ifdef USE_THREAD +extern int threads_started; +#endif + void goaway(sts) int sts; @@ -375,7 +379,10 @@ goaway(sts) (void) save_thread(); donecalls(); - exit_prog(sts); + if (threads_started) + _exit_prog(sts); + else + exit_prog(sts); #else /* USE_THREAD */ |