Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 961:a31e07847063 legacy-trunk
New thread.c from Sjoerd, supports _exit_prog(). Use this in goaway()
to avoid hanging in cleanup().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 17 Aug 1992 08:59:08 +0000 |
| parents | cd40e3eebb49 |
| children | f3d5e2c3b9a3 |
line wrap: on
line diff
--- a/Python/pythonrun.c Mon Aug 17 08:55:12 1992 +0000 +++ b/Python/pythonrun.c Mon Aug 17 08:59:08 1992 +0000 @@ -361,6 +361,10 @@ /* Clean up and exit */ +#ifdef USE_THREAD +extern int threads_started; +#endif + void goaway(sts) int sts; @@ -375,7 +379,10 @@ (void) save_thread(); donecalls(); - exit_prog(sts); + if (threads_started) + _exit_prog(sts); + else + exit_prog(sts); #else /* USE_THREAD */
