code: def synchronized(wrapped):
      
  
      @functools.wraps(wrapped)
      def wrapper(*args, **kwargs):
          self = args[0]
          with self._lock:
              return wrapped(*args, **kwargs)
  
      return wrapper
docs: Synchronization decorator.