summaryrefslogtreecommitdiffstats
path: root/Modules/threadmodule.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 /Modules/threadmodule.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 'Modules/threadmodule.c')
-rw-r--r--Modules/threadmodule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c
index 6ab7ea8..c2d67fc 100644
--- a/Modules/threadmodule.c
+++ b/Modules/threadmodule.c
@@ -31,6 +31,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "thread.h"
+int threads_started = 0;
+
object *ThreadError;
@@ -177,6 +179,8 @@ t_bootstrap(args_raw)
object *args = (object *) args_raw;
object *func, *arg, *res;
+ threads_started++;
+
restore_thread((void *)NULL);
func = gettupleitem(args, 0);
arg = gettupleitem(args, 1);
@@ -230,7 +234,7 @@ thread_exit_prog(self, args)
int sts;
if (!getargs(args, "i", &sts))
return NULL;
- goaway(sts);
+ goaway(sts); /* Calls exit_prog(sts) or _exit_prog(sts) */
for (;;) { } /* Should not be reached */
}