Show
Ignore:
Timestamp:
05/25/08 02:07:01 (16 years ago)
Author:
ppalmers
Message:

merge libffado-2.0 r1199:1206 back to trunk (svn merge -r 1199:1206 svn+ssh://ffadosvn@ffado.org/ffado/branches/libffado-2.0)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/dbus/controlserver.cpp

    r1173 r1211  
    184184    int nbElements=m_Slave.countElements(); 
    185185    if (i<nbElements) { 
     186        m_Slave.lockControl(); 
    186187        const Control::ElementVector elements = m_Slave.getElementVector(); 
    187188        Control::Element *e = elements.at(i); 
    188189        std::string name; 
    189190        if(e) name = e->getName(); 
    190         m_Slave.releaseElementVector(); 
     191        m_Slave.unlockControl(); 
    191192        return name; 
    192193    } else return ""; 
     
    194195//     Util::MutexLockHelper lock(*m_access_lock); 
    195196 
    196 // NOTE: call with access lock held! 
     197// NOTE: call with tree locked 
    197198void 
    198199Container::updateTree() 
     
    263264        to_remove.erase(to_remove.begin()); 
    264265    } 
    265     m_Slave.releaseElementVector(); 
    266266 
    267267    if(something_changed) { 
     
    279279    debugOutput(DEBUG_LEVEL_VERBOSE,  
    280280                "removing handler %p on path %s\n", 
    281                 path().c_str(), e); 
     281                e, path().c_str()); 
    282282    for ( ElementVectorIterator it = m_Children.begin(); 
    283283      it != m_Children.end(); 
     
    313313    // we lock the tree first 
    314314    Lock(); 
     315 
     316    // also lock the slave tree 
     317    m_Slave.lockControl(); 
     318 
    315319    // update our tree 
    316320    updateTree(); 
     321 
     322    // now unlock the slave tree 
     323    m_Slave.unlockControl(); 
     324 
     325    // and unlock the access 
    317326    Unlock(); 
    318327} 
  • trunk/libffado/support/dbus/ffado-dbus-server.cpp

    r1199 r1211  
    300300        conn.request_name("org.ffado.Control"); 
    301301 
     302        // lock the control tree such that it does not get modified while we build our view 
     303        m_deviceManager->lockControl(); 
    302304        container = new DBusControl::Container(conn, "/org/ffado/Control/DeviceManager",  
    303305                                               NULL, *m_deviceManager); 
    304          
     306        // unlock the control tree since the tree is built 
     307        m_deviceManager->unlockControl(); 
     308 
    305309        printMessage("DBUS test service running\n"); 
    306310        printMessage("press ctrl-c to stop it & exit\n"); 
     
    309313            debugOutput( DEBUG_LEVEL_NORMAL, "dispatching...\n"); 
    310314            dispatcher.enter(); 
     315 
    311316            debugOutput( DEBUG_LEVEL_NORMAL, " dispatcher exited...\n"); 
    312317            sem_wait(&run_sem);