summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-24 02:53:45 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-24 02:53:45 +0000
commit0da6b3a13def40e8fd002b9fc60f955467f6372d (patch)
treed4aa39ece30255afe7447fb46f39c45c39d679a3 /src/inspircd.cpp
parent5f309503fa985faa5b255246fc0415455c1c65ee (diff)
OnRehash changes: split to multiple hooks to clarify use and prevent explosion of rehashes on a /REHASH *
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11388 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index a2a634a64..cb019ca7c 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -774,11 +774,9 @@ int InspIRCd::Run()
this->Logs->Log("CONFIG",DEBUG,"Detected ConfigThread exiting, tidying up...");
- /* 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. This might
- * not be worth the effort however as these functions execute relatively quickly
- * and would not benefit from being within the config read thread.
+ /*
+ * Apply the changed configuration from the rehash. This is not done within the
+ * configuration thread becasuse they may invoke functions that are not threadsafe.
*
* XXX: The order of these is IMPORTANT, do not reorder them without testing
* thoroughly!!!
@@ -789,13 +787,9 @@ int InspIRCd::Run()
this->ResetMaxBans();
InitializeDisabledCommands(Config->DisabledCommands, this);
User* user = !Config->RehashUserUID.empty() ? FindNick(Config->RehashUserUID) : NULL;
- FOREACH_MOD_I(this, I_OnRehash, OnRehash(user, Config->RehashParameter));
+ FOREACH_MOD_I(this, I_OnRehash, OnRehash(user));
this->BuildISupport();
- /* 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;
ConfigThread = NULL;
}