Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
callfcgi: Improved recvrec implementation.
[ashd.git]
/
python
/
ashd
/
serve.py
diff --git
a/python/ashd/serve.py
b/python/ashd/serve.py
index
a025cee
..
e9f92b0
100644
(file)
--- a/
python/ashd/serve.py
+++ b/
python/ashd/serve.py
@@
-142,15
+142,17
@@
class freethread(handler):
while len(self.current) >= self.max:
self.tcond.wait()
th = reqthread(target=self.run, args=[req])
while len(self.current) >= self.max:
self.tcond.wait()
th = reqthread(target=self.run, args=[req])
+ th.registered = False
th.start()
th.start()
- while
th.is_alive() and th not in self.current
:
- self.tcond.wait(
1
)
+ while
not th.registered
:
+ self.tcond.wait()
def run(self, req):
try:
th = threading.current_thread()
with self.lk:
self.current.add(th)
def run(self, req):
try:
th = threading.current_thread()
with self.lk:
self.current.add(th)
+ th.registered = True
self.tcond.notify_all()
try:
env = req.mkenv()
self.tcond.notify_all()
try:
env = req.mkenv()
@@
-212,15
+214,17
@@
class resplex(handler):
while len(self.current) >= self.max:
self.tcond.wait()
th = reqthread(target=self.handle1, args=[req])
while len(self.current) >= self.max:
self.tcond.wait()
th = reqthread(target=self.handle1, args=[req])
+ th.registered = False
th.start()
th.start()
- while
th.is_alive() and th not in self.current
:
- self.tcond.wait(
1
)
+ while
not th.registered
:
+ self.tcond.wait()
def handle1(self, req):
try:
th = threading.current_thread()
with self.lk:
self.current.add(th)
def handle1(self, req):
try:
th = threading.current_thread()
with self.lk:
self.current.add(th)
+ th.registered = True
self.tcond.notify_all()
try:
env = req.mkenv()
self.tcond.notify_all()
try:
env = req.mkenv()