From f9f2e82fcade2d44a69bbdac1ba59bdf591743f4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 17 Aug 1992 08:59:08 +0000 Subject: New thread.c from Sjoerd, supports _exit_prog(). Use this in goaway() to avoid hanging in cleanup(). --- Python/pythonrun.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 08d1dbe986..5358ee588b 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 */ -- cgit v1.2.1