def sync(f):
def new_function(self, *args, **kw):<EOL><INDENT>self._lock.acquire()<EOL>try:<EOL><INDENT>return f(self, *args, **kw)<EOL><DEDENT>finally:<EOL><INDENT>self._lock.release()<EOL><DEDENT><DEDENT>return new_function<EOL>
Synchronization decorator.