Skip to content

Commit 2369941

Browse files
minor fixes
1 parent bfb1df2 commit 2369941

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

Lib/test/test_capi/test_misc.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,9 +1557,6 @@ def callback():
15571557

15581558
for i in range(n):
15591559
time.sleep(random.random()*0.02) #0.01 secs on average
1560-
#try submitting callback until successful.
1561-
#rely on regular interrupt to flush queue if we are
1562-
#unsuccessful.
15631560
self.assertTrue(_testcapi._pending_threadfunc(callback))
15641561

15651562
def pendingcalls_submit(self, l, n, *, main=True):

Python/ceval_gil.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -729,13 +729,8 @@ push_pending_call(struct _pending_calls *pending,
729729
call->arg = arg;
730730
call->func = func;
731731
call->flags = flags;
732-
call->next = NULL;
733-
734-
_pending_call **head = &pending->head;
735-
while (*head) {
736-
head = &(*head)->next;
737-
}
738-
*head = call;
732+
call->next = pending->head;
733+
pending->head = call;
739734
_Py_atomic_add_int32(&pending->npending, 1);
740735
return 0;
741736
}

0 commit comments

Comments
 (0)