[Stackless-checkins] r51809 - stackless/Python-2.4.3/dev/Stackless/core/stacklesseval.c

richard.tew python-checkins at python.org
Thu Sep 7 14:30:27 CEST 2006


Author: richard.tew
Date: Thu Sep  7 14:30:26 2006
New Revision: 51809

Modified:
   stackless/Python-2.4.3/dev/Stackless/core/stacklesseval.c
Log:
Ported from trunk r51808. Fix for threading/interpreter exit/tasklet killing bug.  The test case was to have 10 threads launched with a time.sleep(0.1) in each.  This would cause the tasklet killing to have an access violation when it tried to move the tasklet to be killed before the main tasklet in the scheduling list, but the tasklet being killed was the main tasklet.  Now if this is the case, no scheduling ordering changes are made as it is not necessary anyway.

Modified: stackless/Python-2.4.3/dev/Stackless/core/stacklesseval.c
==============================================================================
--- stackless/Python-2.4.3/dev/Stackless/core/stacklesseval.c	(original)
+++ stackless/Python-2.4.3/dev/Stackless/core/stacklesseval.c	Thu Sep  7 14:30:26 2006
@@ -321,7 +321,7 @@
 		 * killed, they will be implicitly placed before this one,
 		 * leaving it to run next.
 		 */
-		if (!t->flags.blocked) {
+		if (!t->flags.blocked && t != cs->tstate->st.main) {
 			chain = &t;
 			SLP_CHAIN_REMOVE(PyTaskletObject, chain, task, next, prev)
 			chain = &cs->tstate->st.main;

_______________________________________________
Stackless-checkins mailing list
Stackless-checkins at stackless.com
http://www.stackless.com/mailman/listinfo/stackless-checkins



More information about the Stackless-checkins mailing list