File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -296,11 +296,17 @@ add_to_pending_deletion_list(_PyExecutorObject *self)
296296 interp -> executor_deletion_list_head = self ;
297297 if (interp -> executor_deletion_list_remaining_capacity > 0 ) {
298298 interp -> executor_deletion_list_remaining_capacity -- ;
299+ EXECUTOR_LIST_UNLOCK (interp );
299300 }
300301 else {
302+ /* Release the lock before calling _Py_ClearExecutorDeletionList
303+ * to avoid deadlock, since it also tries to acquire the same lock */
304+ EXECUTOR_LIST_UNLOCK (interp );
301305 _Py_ClearExecutorDeletionList (interp );
306+ EXECUTOR_LIST_LOCK (interp );
307+ interp -> executor_deletion_list_head = self ;
308+ EXECUTOR_LIST_UNLOCK (interp );
302309 }
303- EXECUTOR_LIST_UNLOCK (interp );
304310}
305311
306312static void
You can’t perform that action at this time.
0 commit comments