//-----------------------------------------------------------------------------
int FIREBIRD_STORE::GetUsersList(std::vector<std::string> * usersList) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
//-----------------------------------------------------------------------------
int FIREBIRD_STORE::AddUser(const std::string & name) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
//-----------------------------------------------------------------------------
int FIREBIRD_STORE::DelUser(const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
int FIREBIRD_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 FIREBIRD_STORE::SaveUserConf(const STG::UserConf & conf,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
st->Execute();
st->Prepare("insert into tb_allowed_ip (fk_user, ip, mask) values (?, ?, ?)");
- for(size_t j = 0; i < conf.ips.count(); j++)
+ for(size_t j = 0; j < conf.ips.count(); j++)
{
st->Set(1, uid);
st->Set(2, (int32_t)conf.ips[j].ip);
int FIREBIRD_STORE::RestoreUserStat(STG::UserStat * stat,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
int FIREBIRD_STORE::RestoreUserConf(STG::UserConf * conf,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
const std::string & newValue,
const std::string & message = "") const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
//-----------------------------------------------------------------------------
int FIREBIRD_STORE::WriteUserConnect(const std::string & login, uint32_t ip) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
double /*freeMb*/,
const std::string & /*reason*/) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
time_t lastStat,
const std::string & login) const
{
-STG_LOCKER lock(&mutex);
+std::lock_guard lock(m_mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
//-----------------------------------------------------------------------------
int FIREBIRD_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);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);