userland: maybe it really works

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent 0c9afcf9b6
commit bbdf6cdc06
5 changed files with 89 additions and 111 deletions

View File

@@ -84,6 +84,9 @@ class ThreadPool:
def __exit__(self, type, value, traceback):
self.join()
def get_error(self):
return self.error_output
def submit(self, work):
'''
Submit work. Block if there is already enough work scheduled (~nthreads).
@@ -117,6 +120,7 @@ class ThreadPool:
out = self.func(**work)
except Exception as e:
exception = e
out = None
try:
handle_output_return = self.handle_output(work, out, exception)
except Exception as e: