diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-23 18:48:42 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-23 18:48:42 +0000 |
commit | f9e6de5284aaacd55aa389445cd595bdcaa8339e (patch) | |
tree | a0fd4a21d17c5aa9d6a21c6b1e7e8022e25e6758 /src/inspircd.cpp | |
parent | 7b6eae36661bc798f69b22393b85a4f06d533cf6 (diff) |
ThreadEngine: remove MutexFactory, mutexes should be constructed using their constructor
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11250 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index e6b863591..7c82b706b 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -151,8 +151,6 @@ void InspIRCd::Cleanup() /* Close logging */ this->Logs->CloseLogs(); DeleteZero(this->Logs); - - delete RehashFinishMutex; } void InspIRCd::Restart(const std::string &reason) @@ -391,10 +389,7 @@ InspIRCd::InspIRCd(int argc, char** argv) SE = SEF->Create(this); delete SEF; - ThreadEngineFactory* tef = new ThreadEngineFactory(); - this->Threads = tef->Create(this); - delete tef; - this->Mutexes = new MutexFactory(this); + this->Threads = new ThreadEngine(this); /* Default implementation does nothing */ this->PI = new ProtocolInterface(this); @@ -756,8 +751,6 @@ int InspIRCd::Run() Exit(0); } - RehashFinishMutex = Mutexes->CreateMutex(); - while (true) { #ifndef WIN32 @@ -769,7 +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(); + RehashFinishMutex.Lock(); if (this->ConfigThread && this->ConfigThread->GetExitFlag()) { /* Rehash has completed */ @@ -805,7 +798,7 @@ int InspIRCd::Run() delete ConfigThread; ConfigThread = NULL; } - RehashFinishMutex->Unlock(); + RehashFinishMutex.Unlock(); /* time() seems to be a pretty expensive syscall, so avoid calling it too much. * Once per loop iteration is pleanty. |