From e83461d2e2e359d5ebbd7d6e553bb994a8e6524d Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 24 Feb 2008 19:08:26 +0000 Subject: Add some important comments git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9029 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index de725d0e1..47c47dbeb 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -636,11 +636,25 @@ int InspIRCd::Run() static char window_title[100]; #endif + /* Check if there is a config thread which has finished executing but has not yet been freed */ if (this->ConfigThread && this->ConfigThread->GetExitFlag()) { /* Rehash has completed */ this->Logs->Log("CONFIG",DEBUG,"Detected ConfigThread exiting, tidying up..."); + + /* IMPORTANT: This delete may hang if you fuck up your thread syncronization. + * It will hang waiting for the ConfigThread to 'join' to avoid race conditons, + * until the other thread is completed. + */ delete ConfigThread; + + /* These are currently not known to be threadsafe, so they are executed outside + * of the thread. It would be pretty simple to move them to the thread Run method + * once they are known threadsafe with all the correct mutexes in place. + * + * XXX: The order of these is IMPORTANT, do not reorder them without testing + * thoroughly!!! + */ this->XLines->CheckELines(); this->XLines->ApplyLines(); this->Res->Rehash(); -- cgit v1.2.3