From 9c38d6e8568186c47103a9980235595b1962c081 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 6 Jan 2014 06:26:45 +0100 Subject: [PATCH] python: Added a safety timeout in the new-thread wait loop. --- python/ashd/serve.py | 4 ++-- python3/ashd/serve.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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: -- 2.11.0