def synchronized(lock):
def wrap(f):<EOL><INDENT>def new_function(*args, **kw):<EOL><INDENT>lock.acquire()<EOL>try:<EOL><INDENT>return f(*args, **kw)<EOL><DEDENT>finally:<EOL><INDENT>lock.release()<EOL><DEDENT><DEDENT>return new_function<EOL><DEDENT>return wrap<EOL>
Synchronization decorator.