code: def synchronized(lock):
      
      @simple_decorator
      def wrap(function_target):
          """Decorator wrapper"""
          def new_function(*args, **kw):
              """Decorated function with Mutex"""
              lock.acquire()
              try:
                  return function_target(*args, **kw)
              finally:
                  lock.release()
          return new_function
      return wrap
docs: Synchronization decorator.
      Allos to set a mutex on any function