mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-31 13:10:37 +00:00
Wait for threads to exit after stopping them
This fixes a race condition where the main thread would check if any internal errors happened and get back a 0 while a worker thread was still busy printing the internal error message before incrementing the counter. Fixes #320. My experiments show that this adds no perceptible delay to the script runtime (on Linux). More specifically, there already is an annoying perceptible delay of about 1 second, but it's not caused by this change.
This commit is contained in:
parent
ade5a5c399
commit
e274d74be2
1 changed files with 2 additions and 0 deletions
|
|
@ -199,6 +199,8 @@ class Aggregate (object):
|
|||
self.cancel()
|
||||
for t in self.threads:
|
||||
t.stop()
|
||||
for t in self.threads:
|
||||
t.join(timeout=1.0)
|
||||
|
||||
@synchronized(_threads_lock)
|
||||
def is_finished (self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue