Browse Source

found another deadlock location, AddTimer is now restricted to 10ms or higher

Image 2 years ago
parent
commit
52d38ca175

+ 3 - 0
EQ2/source/WorldServer/LuaFunctions.cpp

@@ -3396,6 +3396,9 @@ int EQ2Emu_lua_AddTimer(lua_State* state) {
 	Spawn* player = lua_interface->GetSpawn(state, 5);
 
 	SpawnScriptTimer* timer = new SpawnScriptTimer;
+	if ( time < 10)
+		time = 10;
+	
 	timer->timer = Timer::GetCurrentTime2() + time;
 	timer->function = function;
 	timer->spawn = spawn->GetID();

+ 1 - 2
EQ2/source/WorldServer/Zone/mob_movement_manager.cpp

@@ -778,10 +778,9 @@ void MobMovementManager::DisruptNavigation(Entity* who)
 	if (!who->IsRunning()) {
 		who->MCommandMutex.writelock();
 		ent.second.Commands.clear();
-		MobListMutex.releasereadlock();
 		who->MCommandMutex.releasewritelock();
-		return;
 	}
+	MobListMutex.releasereadlock();
 }
 
 /**

+ 2 - 1
EQ2/source/WorldServer/zoneserver.cpp

@@ -3778,7 +3778,8 @@ void ZoneServer::CheckSpawnScriptTimers(){
 		set<SpawnScriptTimer*>::iterator itr;
 		for (itr = spawn_script_timers.begin(); itr != spawn_script_timers.end(); itr++) {
 			timer = *itr;
-			if(timer->current_count < timer->max_count && current_time >= timer->timer){
+			if(remove_spawn_script_timers_list.count(timer) == 0 && 
+				timer->current_count < timer->max_count && current_time >= timer->timer){
 				timer->current_count++;	
 				call_timers.push_back(timer);
 			}