fix pools to use new Queue class

This commit is contained in:
Denis Bilenko
2009-06-22 15:57:01 +07:00
parent 51f9cee438
commit 75143a1b8f

View File

@@ -95,7 +95,7 @@ class Pool(object):
self.current_size -= 1
return
if self.channel.sem.balance < 0:
if self.waiting():
self.channel.send(item)
else:
if self.order_as_stack:
@@ -116,10 +116,8 @@ class Pool(object):
def waiting(self):
"""Return the number of routines waiting for a pool item.
"""
if self.channel.sem.balance < 0:
return -self.channel.sem.balance
return 0
return self.channel.waiting()
def create(self):
"""Generate a new pool item
"""