code: def exclusively(f):
      
      @wraps(f)
      def exclusively_f(self, *a, **kw):
          with self._lock:
              return f(self, *a, **kw)
      return exclusively_f
docs: Decorate a function to make it thread-safe by serializing invocations
      using a per-instance lock.