Ticket #8526: mythbackend_MainServer_BackendQueryDiskSpace_deadlock.patch

File mythbackend_MainServer_BackendQueryDiskSpace_deadlock.patch, 1.0 KB (added by doug@…, 10 years ago)

Patch for second described deadlock

  • programs/mythbackend/mainserver.cpp

     
    39803980        QMap <QString, bool> backendsCounted;
    39813981        QString pbsHost;
    39823982
     3983        list<PlaybackSock *> localPlaybackList;
     3984
    39833985        sockListLock.lockForRead();
    39843986
    39853987        vector<PlaybackSock *>::iterator pbsit = playbackList.begin();
     
    39943996                continue;
    39953997
    39963998            backendsCounted[pbs->getHostname()] = true;
    3997             pbs->GetDiskSpace(strlist);
     3999            pbs->UpRef();
     4000            localPlaybackList.push_back(pbs);
    39984001            allHostList += "," + pbs->getHostname();
    39994002        }
    40004003
    40014004        sockListLock.unlock();
     4005
     4006        for (list<PlaybackSock *>::iterator p = localPlaybackList.begin() ;
     4007             p != localPlaybackList.end() ; ++p) {
     4008            (*p)->GetDiskSpace(strlist);
     4009            (*p)->DownRef();
     4010        }
    40024011    }
    40034012
    40044013    if (!consolidated)