"Synchronized" methods
class MyObject:
def __init__(self):
self._lock = threading.RLock()
# or threading.Lock(), if no reentrancy needed
def some_method(self):
self._lock.acquire()
try:
"go about your business"
finally:
self._lock.release()
Previous slide
Next slide
Back to first slide
View graphic version