#include "stg/user_traff.h"
#include "stg/common.h"
#include "stg/const.h"
-#include "stg/locker.h"
#include "../../../stg_timer.h"
#include <string>
//-----------------------------------------------------------------------------
int POSTGRESQL_STORE::GetUsersList(std::vector<std::string> * usersList) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
//-----------------------------------------------------------------------------
int POSTGRESQL_STORE::AddUser(const std::string & name) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
//-----------------------------------------------------------------------------
int POSTGRESQL_STORE::DelUser(const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
int POSTGRESQL_STORE::SaveUserStat(const STG::UserStat & stat,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
return SaveStat(stat, login);
}
int POSTGRESQL_STORE::SaveUserConf(const STG::UserConf & conf,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
int POSTGRESQL_STORE::RestoreUserStat(STG::UserStat * stat,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
int POSTGRESQL_STORE::RestoreUserConf(STG::UserConf * conf,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
const std::string & newValue,
const std::string & message = "") const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
//-----------------------------------------------------------------------------
int POSTGRESQL_STORE::WriteUserConnect(const std::string & login, uint32_t ip) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
double freeMb,
const std::string & reason) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
time_t lastStat,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
if (PQstatus(connection) != CONNECTION_OK)
{
//-----------------------------------------------------------------------------
int POSTGRESQL_STORE::SaveMonthStat(const STG::UserStat & stat, int month, int year, const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
return SaveStat(stat, login, year, month);
}