[Checkins]
SVN: gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py
Adding an additional loop to join() the threads
Dirceu Pereira Tiegs
dirceutiegs at gmail.com
Tue Jul 15 06:29:11 EDT 2008
Log message for revision 88376:
Adding an additional loop to join() the threads
Changed:
U gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py
-=-
Modified: gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py
===================================================================
--- gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py 2008-07-15 09:08:51 UTC (rev 88375)
+++ gocept.zeoraid/branches/dirceu-distributed-write-calls/src/gocept/zeoraid/storage.py 2008-07-15 10:29:11 UTC (rev 88376)
@@ -640,7 +640,7 @@
"""
class ThreadedApplyStorage(threading.Thread):
def __init__(self, name, method_name, args, kw, expect_connected, __apply_storage):
- threading.Thread.__init__(self)
+ super(ThreadedApplyStorage, self).__init__()
self.name = name
self.method_name = method_name
self.args = args
@@ -671,16 +671,24 @@
applicable_storages = [storage for storage in applicable_storages
if storage not in exclude]
+ _threads = []
for name in applicable_storages:
try:
args = argument_iterable.next()
t = ThreadedApplyStorage(name, method_name, args, kw, expect_connected, self.__apply_storage)
+ _threads.append(t)
t.start()
- t.join(60)
- reliable, result = t.reliable, t.result
except Exception, e:
exceptions.append(e)
raise
+
+ for thread in _threads:
+ try:
+ thread.join(60)
+ reliable, result = thread.reliable, thread.result
+ except Exception, e:
+ exceptions.append(e)
+ raise
else:
if reliable:
results.append(result)
More information about the Checkins
mailing list