Minor refactoring

This commit is contained in:
Miroslav Stampar
2025-07-09 20:53:58 +02:00
parent 71e18a98d2
commit ea892f9d62
3 changed files with 6 additions and 9 deletions

View File

@@ -16,7 +16,6 @@ from lib.core.threads import getCurrentThreadData
_cache = {}
_cache_lock = threading.Lock()
_method_locks = {}
def cachedmethod(f):
"""
@@ -87,14 +86,12 @@ def stackedmethod(f):
return _
def lockedmethod(f):
lock = threading.RLock()
@functools.wraps(f)
def _(*args, **kwargs):
if f not in _method_locks:
_method_locks[f] = threading.RLock()
with _method_locks[f]:
with lock:
result = f(*args, **kwargs)
return result
return _