code: def synchronized(sync_lock):
      
  
      def wrapper(f):
          """The decorator's core function.
  
          :param f:
          :return:
          """
  
          @functools.wraps(f)
          def inner_wrapper(*args, **kw):
              """
  
              :param args:
              :param kw:
              :return:
              """
              with sync_lock:
                  return f(*args, **kw)
  
          return inner_wrapper
  
      return wrapper
docs: A decorator synchronizing multi-process access to a resource.