mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
SF patch 552161 - Py_AddPendingCall doesn't unlock on fail (Daniel
Dunbar) Can't test this, but looks correct to me.
This commit is contained in:
parent
0c32279626
commit
04e7032c6e
1 changed files with 3 additions and 1 deletions
|
@ -379,8 +379,10 @@ Py_AddPendingCall(int (*func)(void *), void *arg)
|
||||||
busy = 1;
|
busy = 1;
|
||||||
i = pendinglast;
|
i = pendinglast;
|
||||||
j = (i + 1) % NPENDINGCALLS;
|
j = (i + 1) % NPENDINGCALLS;
|
||||||
if (j == pendingfirst)
|
if (j == pendingfirst) {
|
||||||
|
busy = 0;
|
||||||
return -1; /* Queue full */
|
return -1; /* Queue full */
|
||||||
|
}
|
||||||
pendingcalls[i].func = func;
|
pendingcalls[i].func = func;
|
||||||
pendingcalls[i].arg = arg;
|
pendingcalls[i].arg = arg;
|
||||||
pendinglast = j;
|
pendinglast = j;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue