def _synchronized(method):
 def synchronized_wrapper(self, *args):
  with self._lock:
   return method(self, *args)
 return synchronized_wrapper

def _synchronized ( method ) : def synchronized_wrapper ( self , * args ) : with self . _lock : return method ( self , * args ) return synchronized_wrapper
a decorator that synchronizes the method call with self .