summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-12 15:04:13 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-12 15:04:13 +0000
commitebe735d5f37b504f0b4c95ca1f827d18b03dae08 (patch)
tree99cf8de8ec874795f97314c9b006cf836c66c402
parent5e83b1cc79b87ed740eee8ffa2a1aa05f0c9e4e3 (diff)
Added a second yield
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2343 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspircd.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 986ae67fe..7f0ea8fd8 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -2654,7 +2654,7 @@ int InspIRCd(char** argv, int argc)
for (;;)
{
#ifdef _POSIX_PRIORITY_SCHEDULING
- sched_yield();
+ sched_yield(); sched_yield();
#endif
// we only read time() once per iteration rather than tons of times!
OLDTIME = TIME;
@@ -2676,9 +2676,12 @@ int InspIRCd(char** argv, int argc)
SE->Wait(activefds);
- for (unsigned int activefd = 0; activefd < activefds.size(); activefd++)
+ unsigned int numberactive = activefds.size();
+ for (unsigned int activefd = 0; activefd < numberactive; activefd++)
{
- if (SE->GetType(activefds[activefd]) == X_ESTAB_CLIENT)
+ int socket_type = SE->GetType(activefds[activefd]);
+
+ if (socket_type == X_ESTAB_CLIENT)
{
log(DEBUG,"Got a ready socket of type X_ESTAB_CLIENT");
userrec* cu = fd_ref_table[activefds[activefd]];
@@ -2688,7 +2691,7 @@ int InspIRCd(char** argv, int argc)
ProcessUser(cu);
}
}
- else if (SE->GetType(activefds[activefd]) == X_ESTAB_MODULE)
+ else if (socket_type == X_ESTAB_MODULE)
{
log(DEBUG,"Got a ready socket of type X_ESTAB_MODULE");
unsigned int numsockets = module_sockets.size();
@@ -2710,14 +2713,14 @@ int InspIRCd(char** argv, int argc)
}
}
}
- else if (SE->GetType(activefds[activefd]) == X_ESTAB_DNS)
+ else if (socket_type == X_ESTAB_DNS)
{
log(DEBUG,"Got a ready socket of type X_ESTAB_DNS");
#ifndef THREADED_DNS
dns_poll(activefds[activefd]);
#endif
}
- else if (SE->GetType(activefds[activefd]) == X_LISTEN)
+ else if (socket_type == X_LISTEN)
{
log(DEBUG,"Got a ready socket of type X_LISTEN");
/* It maybe a listener */