We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6858161 commit fa0dd0bCopy full SHA for fa0dd0b
1 file changed
Python/optimizer.c
@@ -296,11 +296,17 @@ add_to_pending_deletion_list(_PyExecutorObject *self)
296
interp->executor_deletion_list_head = self;
297
if (interp->executor_deletion_list_remaining_capacity > 0) {
298
interp->executor_deletion_list_remaining_capacity--;
299
+ EXECUTOR_LIST_UNLOCK(interp);
300
}
301
else {
302
+ /* Release the lock before calling _Py_ClearExecutorDeletionList
303
+ * to avoid deadlock, since it also tries to acquire the same lock */
304
305
_Py_ClearExecutorDeletionList(interp);
306
+ EXECUTOR_LIST_LOCK(interp);
307
+ interp->executor_deletion_list_head = self;
308
309
- EXECUTOR_LIST_UNLOCK(interp);
310
311
312
static void
0 commit comments