From: Fredrik Tolf Date: Mon, 6 Jan 2014 05:26:45 +0000 (+0100) Subject: python: Added a safety timeout in the new-thread wait loop. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=9c38d6e8568186c47103a9980235595b1962c081;p=ashd.git python: Added a safety timeout in the new-thread wait loop. --- diff --git a/python/ashd/serve.py b/python/ashd/serve.py index 0197d47..a025cee 100644 --- a/python/ashd/serve.py +++ b/python/ashd/serve.py @@ -144,7 +144,7 @@ class freethread(handler): th = reqthread(target=self.run, args=[req]) th.start() while th.is_alive() and th not in self.current: - self.tcond.wait() + self.tcond.wait(1) def run(self, req): try: @@ -214,7 +214,7 @@ class resplex(handler): th = reqthread(target=self.handle1, args=[req]) th.start() while th.is_alive() and th not in self.current: - self.tcond.wait() + self.tcond.wait(1) def handle1(self, req): try: diff --git a/python3/ashd/serve.py b/python3/ashd/serve.py index ebee436..ce17b9d 100644 --- a/python3/ashd/serve.py +++ b/python3/ashd/serve.py @@ -144,7 +144,7 @@ class freethread(handler): th = reqthread(target=self.run, args=[req]) th.start() while th.is_alive() and th not in self.current: - self.tcond.wait() + self.tcond.wait(1) def run(self, req): try: @@ -214,7 +214,7 @@ class resplex(handler): th = reqthread(target=self.handle1, args=[req]) th.start() while th.is_alive() and th not in self.current: - self.tcond.wait() + self.tcond.wait(1) def handle1(self, req): try: