Add locking for threaded operation.

This commit is contained in:
Mike Auty
2019-03-02 18:07:48 +00:00
parent 1e9205a75f
commit 9fadee1a17
4 changed files with 37 additions and 14 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ class DataLayerInterface(interfaces.configuration.ConfigurableInterface, metacla
progress = DummyProgress() # type: ProgressValue
scan_iterator = functools.partial(self._scan_iterator, scanner, sections)
scan_metric = self._scan_metric(scanner, sections)
if scanner.thread_safe and not constants.DISABLE_MULTITHREADED_SCANNING:
if scanner.thread_safe and not constants.PARALLELISM:
progress = multiprocessing.Manager().Value("Q", 0)
scan_chunk = functools.partial(self._scan_chunk, scanner, progress)
with multiprocessing.Pool() as pool: