Ticket #6612: dvbstreamhandler_RemoveListener_tryLock.diff

File dvbstreamhandler_RemoveListener_tryLock.diff, 659 bytes (added by Shane Shrybman, 11 years ago)

Debugging patch for dvbstreamhandler (possible _listener_lock contention)

  • mythtv/libs/libmythtv/dvbstreamhandler.cpp

    void DVBStreamHandler::RemoveListener(MPEGStreamData *data) 
    144144    VERBOSE(VB_RECORD, LOC + "RemoveListener("<<data<<") -- begin");
    145145    assert(data);
    146146
    147     _listener_lock.lock();
     147    while (!_listener_lock.tryLock())
     148    {
     149        VERBOSE(VB_RECORD, LOC + "RemoveListener("<<data<<") -- tryLock() failed");
     150    }
    148151
    149152    VERBOSE(VB_RECORD, LOC + "RemoveListener("<<data<<") -- locked");
    150153