def __make_synchronized(self, f):
        """Local decorator to make a method calling lock acquire/release"""
        def newf(*args, **kw):
            self.__lock.acquire()
            try:
                return f(*args, **kw)
            finally:
                self.__lock.release()
        return newf
Local decorator to make a method calling lock acquire/release
recipes/Python/576462_processingPool_variatiwhich_allows_multiple/recipe-576462.py