summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp14
1 files changed, 14 insertions, 0 deletions
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();