void PROTO::AddUser(const USER & user, bool connect)
{
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
users.push_back(std::make_pair(user.GetIP(), user));
users.back().second.InitNetwork();
bool PROTO::Connect(uint32_t ip)
{
std::list<std::pair<uint32_t, USER> >::iterator it;
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
it = std::find_if(users.begin(), users.end(), HasIP(ip));
if (it == users.end())
return false;
bool PROTO::Disconnect(uint32_t ip)
{
std::list<std::pair<uint32_t, USER> >::iterator it;
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
it = std::find_if(users.begin(), users.end(), HasIP(ip));
if (it == users.end())
return false;
{
int res;
{
- STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+ STG_LOCKER lock(&mutex);
res = poll(&pollFds.front(), pollFds.size(), timeout);
}
if (res < 0)
void PROTO::CheckTimeouts()
{
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
std::list<std::pair<uint32_t, USER> >::iterator it;
for (it = users.begin(); it != users.end(); ++it)
{
bool result = true;
std::vector<struct pollfd>::iterator it;
std::list<std::pair<uint32_t, USER> >::iterator userIt;
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
for (it = pollFds.begin(), userIt = users.begin(); it != pollFds.end() && userIt != users.end(); ++it, ++userIt)
{
if (it->revents)