1
0
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:
patrik
2012-08-29 05:37:56 +00:00
parent c71478d91f
commit 448bb5a71b
22 changed files with 72 additions and 26 deletions

View File

@@ -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