summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-07-17 16:57:13 (GMT)
committerGuido van Rossum <guido@python.org>2002-07-17 16:57:13 (GMT)
commit04e7032c6e7626741a8f211fe2494577420fe2df (patch)
treecd6e1e58dabe497d31b04949ce073a0b09bc8488
parent0c32279626d166fe0e09c571fcfc9af25508b1cd (diff)
downloadcpython-04e7032c6e7626741a8f211fe2494577420fe2df.zip
cpython-04e7032c6e7626741a8f211fe2494577420fe2df.tar.gz
cpython-04e7032c6e7626741a8f211fe2494577420fe2df.tar.bz2
SF patch 552161 - Py_AddPendingCall doesn't unlock on fail (Daniel
Dunbar) Can't test this, but looks correct to me.
-rw-r--r--Python/ceval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ab6d88b..50c832a 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -379,8 +379,10 @@ Py_AddPendingCall(int (*func)(void *), void *arg)
busy = 1;
i = pendinglast;
j = (i + 1) % NPENDINGCALLS;
- if (j == pendingfirst)
+ if (j == pendingfirst) {
+ busy = 0;
return -1; /* Queue full */
+ }
pendingcalls[i].func = func;
pendingcalls[i].arg = arg;
pendinglast = j;