mirror of
https://github.com/nmap/nmap.git
synced 2026-01-19 12:49:02 +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:
@@ -235,11 +235,13 @@ action = function(host)
|
||||
local done
|
||||
-- wait for all threads to finish
|
||||
while( not(done) ) do
|
||||
condvar("wait")
|
||||
done = true
|
||||
for thread in pairs(threads) do
|
||||
if (coroutine.status(thread) ~= "dead") then done = false end
|
||||
end
|
||||
if ( not(done) ) then
|
||||
condvar("wait")
|
||||
end
|
||||
end
|
||||
|
||||
if(dosrv) then
|
||||
@@ -257,11 +259,13 @@ action = function(host)
|
||||
local done
|
||||
-- wait for all threads to finish
|
||||
while( not(done) ) do
|
||||
condvar("wait")
|
||||
done = true
|
||||
for thread in pairs(threads) do
|
||||
if (coroutine.status(thread) ~= "dead") then done = false end
|
||||
end
|
||||
if ( not(done) ) then
|
||||
condvar("wait")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user