[dss-commits] digitalSTROM Server branch, master, updated. 129a3c74df829e673c3b6ec8962bc40632b1e979

git version control dss-commits at forum.digitalstrom.org
Fri Dec 18 10:44:58 CET 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "digitalSTROM Server".

The branch, master has been updated
       via  129a3c74df829e673c3b6ec8962bc40632b1e979 (commit)
      from  545036fce56f3145329a40d99f478d9831730f67 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 129a3c74df829e673c3b6ec8962bc40632b1e979
Author: Patrick Stählin <pstaehlin at futurelab.ch>
Date:   Fri Dec 18 10:42:00 2009 +0100

    Lock the apartment when manipulation the structure
    
    This is a "quick fix" as there are other situations where the Apartment
    needs to be locked, but should fix crashes associated with the
    webinterface.
    
    References #118
    Fixes #243

-----------------------------------------------------------------------

Changes:
diff --git a/core/model.h b/core/model.h
index f99f783..cc14fb7 100644
--- a/core/model.h
+++ b/core/model.h
@@ -801,6 +801,7 @@ namespace dss {
   class Apartment : public boost::noncopyable,
                     public DeviceContainer,
                     public Subsystem,
+                    public LockableObject,
                     private Thread
   {
   private:
diff --git a/core/structuremanipulator.cpp b/core/structuremanipulator.cpp
index eece7bd..712af64 100644
--- a/core/structuremanipulator.cpp
+++ b/core/structuremanipulator.cpp
@@ -15,6 +15,7 @@
 namespace dss {
 
   void StructureManipulator::createZone(Modulator& _modulator, Zone& _zone) {
+    AssertLocked apartmentLocked(&m_Apartment);
     if(!_modulator.isPresent()) {
       throw std::runtime_error("Need modulator to be present");
     }
@@ -24,6 +25,7 @@ namespace dss {
   } // createZone
 
   void StructureManipulator::addDeviceToZone(Device& _device, Zone& _zone) {
+    AssertLocked apartmentLocked(&m_Apartment);
     if(!_device.isPresent()) {
       throw std::runtime_error("Need device to be present");
     }
@@ -50,6 +52,7 @@ namespace dss {
   } // addDeviceToZone
 
   void StructureManipulator::removeZoneOnModulator(Zone& _zone, Modulator& _modulator) {
+    AssertLocked apartmentLocked(&m_Apartment);
     Set presentDevicesInZoneOfModulator = _zone.getDevices().getByModulator(_modulator).getByPresence(true);
     if(presentDevicesInZoneOfModulator.length() != 0) {
       throw std::runtime_error("cannot delete zone if there are still devices present");


hooks/post-receive
-- 
digitalSTROM Server


More information about the dss-commits mailing list