]> www.dolda2000.com Git - ashd.git/commitdiff
python: Added a safety timeout in the new-thread wait loop.
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 6 Jan 2014 05:26:45 +0000 (06:26 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 6 Jan 2014 05:26:45 +0000 (06:26 +0100)
python/ashd/serve.py
python3/ashd/serve.py

index 0197d47daf08f3d469b3b450a91641aadc094248..a025cee4de1e6342ccb5718383b38d037aea0919 100644 (file)
@@ -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:
index ebee436e511177e6c67c6db29e8af18f8ecdaaf0..ce17b9d2b8b1e93b14e583e2d31d57dfe3f55507 100644 (file)
@@ -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: