def synchronized(fn):
  @functools.wraps(fn)
  def wrapper(self, *args, **kwargs):
    with self._heap_lock:
      return fn(self, *args, **kwargs)
  return wrapper
Runs the wrapped method under a lock.
dataset/ETHPy150Open steveniemitz/scales/scales/loadbalancer/heap.py/synchronized