mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +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:
parent
d34f06ea49
commit
fa93527653
1 changed files with 4 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue