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

Skip to content

Commit f23339a

Browse files
author
Charles-François Natali
committed
Issue 12620: Make pendingbusy flag static to Py_MakePendingCalls().
1 parent d2d7a3b commit f23339a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Python/ceval.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ static struct {
491491
} pendingcalls[NPENDINGCALLS];
492492
static int pendingfirst = 0;
493493
static int pendinglast = 0;
494-
static char pendingbusy = 0;
495494

496495
int
497496
Py_AddPendingCall(int (*func)(void *), void *arg)
@@ -538,6 +537,7 @@ Py_AddPendingCall(int (*func)(void *), void *arg)
538537
int
539538
Py_MakePendingCalls(void)
540539
{
540+
static int busy = 0;
541541
int i;
542542
int r = 0;
543543

@@ -552,9 +552,9 @@ Py_MakePendingCalls(void)
552552
if (main_thread && PyThread_get_thread_ident() != main_thread)
553553
return 0;
554554
/* don't perform recursive pending calls */
555-
if (pendingbusy)
555+
if (busy)
556556
return 0;
557-
pendingbusy = 1;
557+
busy = 1;
558558
/* perform a bounded number of calls, in case of recursion */
559559
for (i=0; i<NPENDINGCALLS; i++) {
560560
int j;
@@ -583,7 +583,7 @@ Py_MakePendingCalls(void)
583583
if (r)
584584
break;
585585
}
586-
pendingbusy = 0;
586+
busy = 0;
587587
return r;
588588
}
589589

0 commit comments

Comments
 (0)