def handle_message(self, msg):
        """Needed by the ReceiverThread object: dispatch the messages
        to the caller threads"""
        xid, result = msg
        self.__lock.acquire()
        try:
            slot = self.__waitq[xid]
            slot[1] = msg
            slot[0].set() # wake up the caller thread
        finally:
            self.__lock.release()
Needed by the ReceiverThread object: dispatch the messages
        to the caller threads
recipes/Python/576520_Multithreaded_MultiplexerDemultiplexer_allow/recipe-576520.py