Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04e7032

Browse files
committed
SF patch 552161 - Py_AddPendingCall doesn't unlock on fail (Daniel
Dunbar) Can't test this, but looks correct to me.
1 parent 0c32279 commit 04e7032

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Python/ceval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,10 @@ Py_AddPendingCall(int (*func)(void *), void *arg)
379379
busy = 1;
380380
i = pendinglast;
381381
j = (i + 1) % NPENDINGCALLS;
382-
if (j == pendingfirst)
382+
if (j == pendingfirst) {
383+
busy = 0;
383384
return -1; /* Queue full */
385+
}
384386
pendingcalls[i].func = func;
385387
pendingcalls[i].arg = arg;
386388
pendinglast = j;

0 commit comments

Comments
 (0)