git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SETTINGS definition and implementation extracted from main.cpp to
[stg.git]
/
projects
/
stargazer
/
users_impl.cpp
diff --git
a/projects/stargazer/users_impl.cpp
b/projects/stargazer/users_impl.cpp
index 3384c6602ce48ecb3a273ff1744df1c77db67f43..249551875b3beb4ea44276849197bf63f23744d4 100644
(file)
--- a/
projects/stargazer/users_impl.cpp
+++ b/
projects/stargazer/users_impl.cpp
@@
-52,7
+52,7
@@
extern const volatile time_t stgTime;
//#define USERS_DEBUG 1
//-----------------------------------------------------------------------------
//#define USERS_DEBUG 1
//-----------------------------------------------------------------------------
-USERS_IMPL::USERS_IMPL(SETTINGS * s, STORE * st, TARIFFS * t, const ADMIN * sa)
+USERS_IMPL::USERS_IMPL(SETTINGS
_IMPL
* s, STORE * st, TARIFFS * t, const ADMIN * sa)
: users(),
usersToDelete(),
userIPNotifiersBefore(),
: users(),
usersToDelete(),
userIPNotifiersBefore(),
@@
-336,7
+336,7
@@
while (ui != us->users.end())
{
us->UnSetUserNotifiers(ui);
us->DelUserFromIndexes(ui);
{
us->UnSetUserNotifiers(ui);
us->DelUserFromIndexes(ui);
-
ui++
;
+
++ui
;
}
list<USER_TO_DEL>::iterator iter;
}
list<USER_TO_DEL>::iterator iter;
@@
-373,7
+373,7
@@
if (TimeToWriteDetailStat(t))
{
usersCnt++;
usr->WriteDetailStat();
{
usersCnt++;
usr->WriteDetailStat();
-
usr++
;
+
++usr
;
if (usersCnt % 10 == 0)
for_each(users.begin(), users.end(), mem_fun_ref(&USER_IMPL::Run));
}
if (usersCnt % 10 == 0)
for_each(users.begin(), users.end(), mem_fun_ref(&USER_IMPL::Run));
}
@@
-467,13
+467,13
@@
if (!isRunning)
nonstop = false;
//5 seconds to thread stops itself
nonstop = false;
//5 seconds to thread stops itself
-
unsigned i
;
-for (i = 0; i < 25 * (users.size() / 50 + 1); i++)
+
struct timespec ts = {0, 200000000}
;
+for (
size_t
i = 0; i < 25 * (users.size() / 50 + 1); i++)
{
if (!isRunning)
break;
{
if (!isRunning)
break;
-
usleep(200000
);
+
nanosleep(&ts, NULL
);
}
//after 5 seconds waiting thread still running. now kill it
}
//after 5 seconds waiting thread still running. now kill it
@@
-710,7
+710,7
@@
while (bi != userIPNotifiersBefore.end())
//printfd(__FILE__, "Notifier Before removed. User %s\n", bi->GetUser()->GetLogin().c_str());
break;
}
//printfd(__FILE__, "Notifier Before removed. User %s\n", bi->GetUser()->GetLogin().c_str());
break;
}
-
bi++
;
+
++bi
;
}
ai = userIPNotifiersAfter.begin();
}
ai = userIPNotifiersAfter.begin();
@@
-723,7
+723,7
@@
while (ai != userIPNotifiersAfter.end())
//printfd(__FILE__, "Notifier After removed. User %s\n", ai->GetUser()->GetLogin().c_str());
break;
}
//printfd(__FILE__, "Notifier After removed. User %s\n", ai->GetUser()->GetLogin().c_str());
break;
}
-
ai++
;
+
++ai
;
}
}
//-----------------------------------------------------------------------------
}
}
//-----------------------------------------------------------------------------