summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-08-17 08:59:08 (GMT)
committerGuido van Rossum <guido@python.org>1992-08-17 08:59:08 (GMT)
commitf9f2e82fcade2d44a69bbdac1ba59bdf591743f4 (patch)
tree0d9a0201382025d0a09e75cbdf37973a8b8cb32f /Python/pythonrun.c
parent0297512a08698cdee4bebe044a40b08b406398a8 (diff)
downloadcpython-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.c9
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 */