1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-02 04:49:02 +00:00

canonicalize some code

This commit is contained in:
batrick
2011-05-11 14:38:52 +00:00
parent 1cd183014d
commit 186cb2d6a3
3 changed files with 12 additions and 16 deletions

View File

@@ -133,10 +133,9 @@ local function dispatcher()
s_condvar "broadcast"
end
local n = table.getn(threads)
if ( n == 0 ) then break end
for i=1,n do
local status, res = coroutine.resume(threads[i])
if #threads == 0 then break end
for i, thread in ipairs(threads) do
local status, res = coroutine.resume(thread)
if ( not(res) ) then -- thread finished its task?
table.remove(threads, i)
break
@@ -336,4 +335,4 @@ function waitFile( filename, timeout )
waitLast()
return false
end
end