def get_listen_port(self): self.sesslock.acquire() try: return SessionConfigInterface.get_listen_port(self) finally: self.sesslock.release()