summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-23 20:42:17 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-23 20:42:17 +0000
commite7150d29f4897d595c9ee2218e190d6cf42f191b (patch)
treefd63b14d0b940b1c14d2d6989f589ec7dc249222 /src
parent47a902e1f647fc017560b9a85eaddc64dc29aad8 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp1
-rw-r--r--src/inspircd.cpp4
-rw-r--r--src/server.cpp2
3 files changed, 2 insertions, 5 deletions
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()