]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/firebird/firebird_store_services.cpp
Merge remote-tracking branch 'github/master'
[stg.git] / projects / stargazer / plugins / store / firebird / firebird_store_services.cpp
index 0056879ed24a45ccbbd37e7ffe55c3b14cba691f..2afe11812b5f04df0e62638d9b6eb5cd3d082881 100644 (file)
 //-----------------------------------------------------------------------------
 int FIREBIRD_STORE::GetServicesList(std::vector<std::string> * servicesList) 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);
 
-std::string name;
-
 try
     {
     tr->Start();
     st->Execute("select name from tb_services");
     while (st->Fetch())
         {
+        std::string name;
         st->Get(1, name);
         servicesList->push_back(name);
         }
@@ -68,7 +67,7 @@ return 0;
 //-----------------------------------------------------------------------------
 int FIREBIRD_STORE::SaveService(const STG::ServiceConf & sc) 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);
@@ -103,7 +102,7 @@ return 0;
 int FIREBIRD_STORE::RestoreService(STG::ServiceConf * sc,
                                    const std::string & name) 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);
@@ -145,7 +144,7 @@ return 0;
 //-----------------------------------------------------------------------------
 int FIREBIRD_STORE::AddService(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);
@@ -173,7 +172,7 @@ return 0;
 //-----------------------------------------------------------------------------
 int FIREBIRD_STORE::DelService(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);