diff Modules/threadmodule.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 c156d4960c2b
children 9ae65ee09735
line wrap: on
line diff
--- a/Modules/threadmodule.c	Mon Aug 17 08:55:12 1992 +0000
+++ b/Modules/threadmodule.c	Mon Aug 17 08:59:08 1992 +0000
@@ -31,6 +31,8 @@
 
 #include "thread.h"
 
+int threads_started = 0;
+
 object *ThreadError;
 
 
@@ -177,6 +179,8 @@
 	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 @@
 	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 */
 }