Files
SpecterOps-Nemesis/libs/common/common/utils.py
T
Lee Christensen 8035a6a168 add code
2025-06-13 11:33:07 +02:00

18 lines
333 B
Python

from threading import Lock
class ThreadSafeCounter:
def __init__(self):
self._value = 0
self._lock = Lock()
def increment(self):
with self._lock:
self._value += 1
return self._value
@property
def value(self):
with self._lock:
return self._value