@contextmanager<EOL><INDENT>def synchronized(self):<DEDENT>
self.enter_sync()<EOL>try:<EOL><INDENT>yield<EOL>self.exit_sync()<EOL><DEDENT>finally:<EOL><INDENT>pass<EOL><DEDENT>
Synchronize the execution of a section of code between threads.