]> granicus.if.org Git - python/commitdiff
SF patch 552161 - Py_AddPendingCall doesn't unlock on fail (Daniel
authorGuido van Rossum <guido@python.org>
Wed, 17 Jul 2002 16:57:13 +0000 (16:57 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 17 Jul 2002 16:57:13 +0000 (16:57 +0000)
Dunbar)

Can't test this, but looks correct to me.

Python/ceval.c

index ab6d88b41a2dce4a856cad3f94b22fe6c2a9fa59..50c832aa257f8b5326a3437da51dc0863a0a5482 100644 (file)
@@ -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;