Changeset 1211 for trunk/libffado/support
- Timestamp:
- 05/25/08 02:07:01 (16 years ago)
- Files:
-
- trunk/libffado/support/dbus/controlserver.cpp (modified) (5 diffs)
- trunk/libffado/support/dbus/ffado-dbus-server.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/support/dbus/controlserver.cpp
r1173 r1211 184 184 int nbElements=m_Slave.countElements(); 185 185 if (i<nbElements) { 186 m_Slave.lockControl(); 186 187 const Control::ElementVector elements = m_Slave.getElementVector(); 187 188 Control::Element *e = elements.at(i); 188 189 std::string name; 189 190 if(e) name = e->getName(); 190 m_Slave. releaseElementVector();191 m_Slave.unlockControl(); 191 192 return name; 192 193 } else return ""; … … 194 195 // Util::MutexLockHelper lock(*m_access_lock); 195 196 196 // NOTE: call with access lock held!197 // NOTE: call with tree locked 197 198 void 198 199 Container::updateTree() … … 263 264 to_remove.erase(to_remove.begin()); 264 265 } 265 m_Slave.releaseElementVector();266 266 267 267 if(something_changed) { … … 279 279 debugOutput(DEBUG_LEVEL_VERBOSE, 280 280 "removing handler %p on path %s\n", 281 path().c_str(), e);281 e, path().c_str()); 282 282 for ( ElementVectorIterator it = m_Children.begin(); 283 283 it != m_Children.end(); … … 313 313 // we lock the tree first 314 314 Lock(); 315 316 // also lock the slave tree 317 m_Slave.lockControl(); 318 315 319 // update our tree 316 320 updateTree(); 321 322 // now unlock the slave tree 323 m_Slave.unlockControl(); 324 325 // and unlock the access 317 326 Unlock(); 318 327 } trunk/libffado/support/dbus/ffado-dbus-server.cpp
r1199 r1211 300 300 conn.request_name("org.ffado.Control"); 301 301 302 // lock the control tree such that it does not get modified while we build our view 303 m_deviceManager->lockControl(); 302 304 container = new DBusControl::Container(conn, "/org/ffado/Control/DeviceManager", 303 305 NULL, *m_deviceManager); 304 306 // unlock the control tree since the tree is built 307 m_deviceManager->unlockControl(); 308 305 309 printMessage("DBUS test service running\n"); 306 310 printMessage("press ctrl-c to stop it & exit\n"); … … 309 313 debugOutput( DEBUG_LEVEL_NORMAL, "dispatching...\n"); 310 314 dispatcher.enter(); 315 311 316 debugOutput( DEBUG_LEVEL_NORMAL, " dispatcher exited...\n"); 312 317 sem_wait(&run_sem);