def close(self):
        """close the endpoint in both send/receive directions"""
        self._wlock.acquire()
        try:
            os.close(self._fd_w)
        finally:
            self._wlock.release()

        os.close(self._fd_r)
close the endpoint in both send/receive directions
recipes/Python/576520_Multithreaded_MultiplexerDemultiplexer_allow/recipe-576520.py