]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Make the message when reloading a command fails more accurate, and fix reloading...
[user/henk/code/inspircd.git] / src / inspircd.cpp
index e6b86359127ab60e75dad3af5d38b6f12a63997f..ab67449a2abeb1f55b4ebd635aec1477b5a59a60 100644 (file)
@@ -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,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 */
 
@@ -805,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.