diff options
author | Adam <Adam@anope.org> | 2011-09-05 18:44:43 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-09-10 02:06:31 -0400 |
commit | 63cb8ca24c0d4003343340bb8413b7f84de1a6a3 (patch) | |
tree | d71f0cead730065dd8509e284d66b6767e7ebd25 /src/main.cpp | |
parent | dc5d1fa21c20000b77bf713585333c79121a8df0 (diff) |
Moved signal/thread/mode checking to use signal pipes
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/main.cpp b/src/main.cpp index 69a5fe38f..aab9edce5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -207,21 +207,10 @@ void Signal::SignalHandler(int signal) { for (unsigned i = 0, j = SignalHandlers.size(); i < j; ++i) if (SignalHandlers[i]->signal == signal) - SignalHandlers[i]->called = true; + SignalHandlers[i]->Notify(); } -void Signal::Process() -{ - for (unsigned i = 0, j = SignalHandlers.size(); i < j; ++i) - if (SignalHandlers[i]->called == true) - { - Signal *s = SignalHandlers[i]; - s->called = false; - s->OnSignal(); - } -} - -Signal::Signal(int s) : called(false), signal(s) +Signal::Signal(int s) : Pipe(), signal(s) { memset(&this->old, 0, sizeof(this->old)); @@ -244,7 +233,6 @@ Signal::~Signal() sigaction(this->signal, &this->old, NULL); } - /*************************************************************************/ /** The following comes from InspIRCd to get the full path of the Anope executable @@ -355,9 +343,6 @@ int main(int ac, char **av, char **envp) { Log(LOG_DEBUG_2) << "Top of main loop"; - /* Process signals */ - Signal::Process(); - /* Process timers */ if (Anope::CurTime - last_check >= Config->TimeoutCheck) { @@ -365,13 +350,6 @@ int main(int ac, char **av, char **envp) last_check = Anope::CurTime; } - /* Free up any finished threads */ - threadEngine.Process(); - - /* Process any modes that need to be (un)set */ - if (Me->IsSynced()) - ModeManager::ProcessModes(); - /* Process the socket engine */ SocketEngine::Process(); } |