mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-09 15:14:45 +00:00
avoid deadlock with cache lock
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2395 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
db299a1ead
commit
131bea1a59
1 changed files with 3 additions and 2 deletions
|
|
@ -131,10 +131,11 @@ class Consumer (linkcheck.lock.AssertLock):
|
|||
"""
|
||||
Return True if checking is finished.
|
||||
"""
|
||||
# avoid deadlock by requesting cache data before locking
|
||||
tocheck = self.cache.incoming_len()
|
||||
self.acquire()
|
||||
try:
|
||||
return self.threader.finished() and \
|
||||
self.cache.incoming_len() <= 0
|
||||
return self.threader.finished() and tocheck <= 0
|
||||
finally:
|
||||
self.release()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue