1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-30 18:19:05 +00:00

Changed waiting2running to push threads to the back of running, it

caused some nasty bugs when a thread would yield and pop front (a
thread just added).
This commit is contained in:
batrick
2008-06-21 18:52:08 +00:00
parent d34f06ea49
commit fa93527653

View File

@@ -358,9 +358,9 @@ int process_mainloop(lua_State *L) {
}
while(running_scripts.begin() != running_scripts.end()){
while (!running_scripts.empty()) {
current = *(running_scripts.begin());
if (current.rr->host->timedOut(&now))
state = LUA_ERRRUN;
else
@@ -468,7 +468,8 @@ int process_waiting2running(lua_State* L, int resume_arguments) {
// put the thread back into the running
// queue
running_scripts.push_front((*iter));
//running_scripts.push_front((*iter));
running_scripts.push_back((*iter));
waiting_scripts.erase(iter);
return SCRIPT_ENGINE_SUCCESS;