X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8e80bb9cec2c90dd61f810fb1525932a434288eb..2196a3a0cdc5384c082febb7f4aa5994cc7d80db:/projects/stargazer/plugins/store/postgresql/postgresql_store_services.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_services.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_services.cpp index 3d098161..2b99fcee 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_services.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_services.cpp @@ -31,7 +31,6 @@ #include "stg/service_conf.h" #include "stg/common.h" -#include "stg/locker.h" #include #include @@ -42,7 +41,7 @@ //----------------------------------------------------------------------------- int POSTGRESQL_STORE::GetServicesList(std::vector * servicesList) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -98,7 +97,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::SaveService(const STG::ServiceConf & sc) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -178,7 +177,7 @@ return 0; int POSTGRESQL_STORE::RestoreService(STG::ServiceConf * sc, const std::string & name) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -265,7 +264,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::AddService(const std::string & name) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) { @@ -332,7 +331,7 @@ return 0; //----------------------------------------------------------------------------- int POSTGRESQL_STORE::DelService(const std::string & name) const { -STG_LOCKER lock(&mutex); +std::lock_guard lock(m_mutex); if (PQstatus(connection) != CONNECTION_OK) {