1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00

Don't hang waiting for threads that don't exist if they errored out

This commit is contained in:
dmiller
2018-03-10 03:09:33 +00:00
parent 918c24a540
commit fcde4166be

View File

@@ -807,7 +807,7 @@ Engine = {
break
end
-- Updtae tick and add this thread to the batch
-- Update tick and add this thread to the batch
self.tick = self.tick + 1
if not (self.batch:isFull()) and not thread_data.in_batch then
@@ -1218,14 +1218,17 @@ Engine = {
end
local threads = self:threadCount()
stdnse.debug2("Status: #threads = %d, #retry_accounts = %d, initial_accounts_exhausted = %s, waiting = %d",
self:threadCount(), #self.retry_accounts, tostring(self.initial_accounts_exhausted),
threads, #self.retry_accounts, tostring(self.initial_accounts_exhausted),
nmap.socket.get_stats().connect_waiting)
-- wake up other threads
-- wait for all threads to finish running
condvar "broadcast"
condvar "wait"
if threads > 0 then
-- wake up other threads
-- wait for all threads to finish running
condvar "broadcast"
condvar "wait"
end
end