X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b27841d687ec9e84983340b5581376dfb24010ea..2196a3a0cdc5384c082febb7f4aa5994cc7d80db:/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp index 1b68da80..085675c3 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp @@ -30,7 +30,6 @@ #include "stg/tariff_conf.h" #include "stg/common.h" -#include "stg/locker.h" #include #include @@ -49,7 +48,7 @@ const int pt_mega = 1024 * 1024; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::GetTariffsList(std::vector * tariffsList) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -105,7 +104,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::AddTariff(const std::string & name) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -168,7 +167,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::DelTariff(const std::string & name) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -232,7 +231,7 @@ return 0; int POSTGRESQL_STORE::SaveTariff(const STG::TariffData & td, const std::string & tariffName) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -417,7 +416,7 @@ return 0; int POSTGRESQL_STORE::RestoreTariff(STG::TariffData * td, const std::string & tariffName) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) {