Index: trunk/FACT++/src/StateMachineDimControl.cc
===================================================================
--- trunk/FACT++/src/StateMachineDimControl.cc	(revision 15040)
+++ trunk/FACT++/src/StateMachineDimControl.cc	(revision 15041)
@@ -315,5 +315,5 @@
 int StateMachineDimControl::HandleStates(const string &server, DimDescriptions *dim)
 {
-    fMutex.lock();
+    const lock_guard<mutex> guard(fMutex);
 
     const auto is = fCurrentStateList.find(server);
@@ -332,6 +332,4 @@
     }
 
-    fMutex.unlock();
-
     return GetCurrentState();
 }
@@ -339,10 +337,8 @@
 int StateMachineDimControl::HandleDescriptions(DimDescriptions *dim)
 {
-    fMutex.lock();
+    const lock_guard<mutex> guard(fMutex);
 
     for (auto it=dim->descriptions.begin(); it!=dim->descriptions.end(); it++)
         fServiceDescriptionList[it->front().name].assign(it->begin(), it->end());
-
-    fMutex.unlock();
 
     return GetCurrentState();
@@ -382,7 +378,7 @@
     // Make a copy of the list to be able to
     // lock the access to the list
-    fMutex.lock();
+
+    const lock_guard<mutex> guard(fMutex);
     fServerList.insert(server);
-    fMutex.unlock();
 
     return GetCurrentState();
@@ -391,7 +387,6 @@
 int StateMachineDimControl::HandleServerRemove(const string &server)
 {
-    fMutex.lock();
+    const lock_guard<mutex> guard(fMutex);
     fServerList.erase(server);
-    fMutex.unlock();
 
     return GetCurrentState();
@@ -402,5 +397,5 @@
     vector<string> rc;
 
-    fMutex.lock();
+    const lock_guard<mutex> guard(fMutex);
 
     rc.reserve(fServerList.size());
@@ -408,6 +403,4 @@
         rc.push_back(*it);
 
-    fMutex.unlock();
-
     return rc;
 }
@@ -435,5 +428,5 @@
     vector<string> rc;
 
-    fMutex.lock();
+    const lock_guard<mutex> guard(fMutex);
 
     for (auto it=fServiceList.begin(); it!=fServiceList.end(); it++)
@@ -441,6 +434,11 @@
             rc.push_back(it->server+"/"+it->service);
 
-    fMutex.unlock();
     return rc;
+}
+
+set<Service> StateMachineDimControl::GetServiceList()
+{
+    const lock_guard<mutex> guard(fMutex);
+    return fServiceList;
 }
 
@@ -467,7 +465,6 @@
     // Make a copy of the list to be able to
     // lock the access to the list
-    fMutex.lock();
+    const lock_guard<mutex> guard(fMutex);
     fServiceList.insert(svc);
-    fMutex.unlock();
 
     return GetCurrentState();
@@ -476,9 +473,6 @@
 bool StateMachineDimControl::HasServer(const std::string &server)
 {
-    fMutex.lock();
-    const bool rc = fServerList.find(server)!=fServerList.end();
-    fMutex.unlock();
-
-    return rc;
+    const lock_guard<mutex> guard(fMutex);
+    return fServerList.find(server)!=fServerList.end();
 }
 
Index: trunk/FACT++/src/StateMachineDimControl.h
===================================================================
--- trunk/FACT++/src/StateMachineDimControl.h	(revision 15040)
+++ trunk/FACT++/src/StateMachineDimControl.h	(revision 15041)
@@ -61,5 +61,5 @@
     std::vector<Description> GetDescription(const std::string &service);
     std::vector<State>       GetStates(const std::string &server);
-
+    std::set<Service>        GetServiceList();
 
     int PrintStates(std::ostream &out, const std::string &serv="");
