فهرست منبع

quest read lock vs lock

Emagi 1 سال پیش
والد
کامیت
f87bcb22be
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      EQ2/source/WorldServer/LuaInterface.cpp

+ 2 - 2
EQ2/source/WorldServer/LuaInterface.cpp

@@ -410,7 +410,7 @@ bool LuaInterface::CallQuestFunction(Quest* quest, const char* function, Spawn*
 	if(quest){
 		LogWrite(LUA__DEBUG, 0, "LUA", "Quest: %s, function: %s", quest->GetName(), function);
 		Mutex* mutex = GetQuestMutex(quest);
-		mutex->lock();
+		mutex->readlock(__FUNCTION__, __LINE__);
 		if(quest_states.count(quest->GetQuestID()) > 0)
 			state = quest_states[quest->GetQuestID()];
 		bool success = false; // if no state then we return false
@@ -428,7 +428,7 @@ bool LuaInterface::CallQuestFunction(Quest* quest, const char* function, Spawn*
 			
 			success = CallScriptInt32(state, arg_count, returnValue);
 		}
-		mutex->unlock();
+		mutex->releasereadlock(__FUNCTION__, __LINE__);
 		LogWrite(LUA__DEBUG, 0, "LUA", "Done!");
 		return success;
 	}