mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 16:39:03 +00:00
fixed a bug in a loop where the script would wait for a condition that was
supposed to be signalled by other threads which were no longer running.
This commit is contained in:
@@ -167,10 +167,12 @@ action = function(host)
|
||||
|
||||
local condvar = nmap.condvar(result)
|
||||
repeat
|
||||
condvar "wait"
|
||||
for t in pairs(threads) do
|
||||
if ( coroutine.status(t) == "dead" ) then threads[t] = nil end
|
||||
end
|
||||
if ( next(threads) ) then
|
||||
condvar "wait"
|
||||
end
|
||||
until( next(threads) == nil )
|
||||
|
||||
table.sort(result, function(a,b) return a.name < b.name end)
|
||||
|
||||
Reference in New Issue
Block a user