diff --git a/src/calibre/utils/safe_atexit.py b/src/calibre/utils/safe_atexit.py index 651ed9669e..2beb36e917 100644 --- a/src/calibre/utils/safe_atexit.py +++ b/src/calibre/utils/safe_atexit.py @@ -10,12 +10,12 @@ import sys import time from contextlib import suppress from functools import wraps -from threading import Lock +from threading import RLock _plat = sys.platform.lower() iswindows = 'win32' in _plat or 'win64' in _plat -lock = Lock() +lock = RLock() worker = None RMTREE_ACTION = 'rmtree' UNLINK_ACTION = 'unlink'