From e7150d29f4897d595c9ee2218e190d6cf42f191b Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 23 Mar 2009 20:42:17 +0000 Subject: ConfigReaderThread updates: add done flag, remove main-thread-only mutex git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11256 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 1 + src/inspircd.cpp | 4 +--- src/server.cpp | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/configreader.cpp b/src/configreader.cpp index 6444ee211..d8f733929 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -2372,4 +2372,5 @@ bool DoneELine(ServerConfig* conf, const char* tag) void ConfigReaderThread::Run() { ServerInstance->Config->Read(do_bail, TheUserUID); + done = true; } diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 7c82b706b..ab67449a2 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -762,8 +762,7 @@ int InspIRCd::Run() #endif /* Check if there is a config thread which has finished executing but has not yet been freed */ - RehashFinishMutex.Lock(); - if (this->ConfigThread && this->ConfigThread->GetExitFlag()) + if (this->ConfigThread && this->ConfigThread->IsDone()) { /* Rehash has completed */ @@ -798,7 +797,6 @@ int InspIRCd::Run() delete ConfigThread; ConfigThread = NULL; } - RehashFinishMutex.Unlock(); /* time() seems to be a pretty expensive syscall, so avoid calling it too much. * Once per loop iteration is pleanty. diff --git a/src/server.cpp b/src/server.cpp index 46c17d14a..c7ebc187e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -48,7 +48,6 @@ void InspIRCd::Exit(int status) void RehashHandler::Call(const std::string &reason) { - Server->RehashFinishMutex.Lock(); Server->SNO->WriteToSnoMask('A', "Rehashing config file %s %s",ServerConfig::CleanFilename(Server->ConfigFileName), reason.c_str()); Server->RehashUsersAndChans(); FOREACH_MOD_I(Server, I_OnGarbageCollect, OnGarbageCollect()); @@ -60,7 +59,6 @@ void RehashHandler::Call(const std::string &reason) Server->ConfigThread = new ConfigReaderThread(Server, false, ""); Server->Threads->Start(Server->ConfigThread); } - Server->RehashFinishMutex.Unlock(); } void InspIRCd::RehashServer() -- cgit v1.2.3