Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 authored Oct 16, 2024
1 parent 2369941 commit ce6bd79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ pending_threadfunc(PyObject *self, PyObject *arg, PyObject *kwargs)
unsigned int num_added = 0;
for (; num_added < num; num_added++) {
if (Py_AddPendingCall(&_pending_callback, callable) < 0) {
// out of memory and freelist is empty
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions Python/ceval_gil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,8 @@ Py_MakePendingCalls(void)
void
_PyEval_InitState(PyInterpreterState *interp)
{
// Fill the pending freelist so that signal handlers can safely
// add pending calls without needing to allocate memory.
struct _pending_calls *pending = &interp->ceval.pending;
PyMutex_Lock(&pending->mutex);
fill_pending_freelist(pending);
Expand Down

0 comments on commit ce6bd79

Please sign in to comment.