This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent 0ef494b681
commit aea97698c3
48 changed files with 840 additions and 798 deletions

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env python3
from typing import Any, Callable, Dict, Iterable, Union
import multiprocessing
import queue
import sys
import threading
@@ -66,7 +65,7 @@ class ThreadPool:
handle_output = lambda input, output, exception: exception
self.handle_output = handle_output
if nthreads is None:
nthreads = multiprocessing.cpu_count()
nthreads = len(os.sched_getaffinity(0))
self.nthreads = nthreads
self.error_output = None
self.error_output_lock = threading.Lock()