From 41537b37ee2a1f6521e98653d6147f71640ebe4d Mon Sep 17 00:00:00 2001 From: Antti Ajanki Date: Thu, 26 Aug 2010 20:16:41 +0300 Subject: release mutex before calling Read() --- src/vdr-plugin/download.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/vdr-plugin') diff --git a/src/vdr-plugin/download.c b/src/vdr-plugin/download.c index 553e2ec..ffdfa54 100644 --- a/src/vdr-plugin/download.c +++ b/src/vdr-plugin/download.c @@ -186,23 +186,27 @@ void cWebviThread::Action(void) { Cancel(-1); ActivateNewRequest(); } else { - bool handled = false; + cMenuRequest *match = NULL; if (has_request_files) { requestMutex.Lock(); for (int i=0; iFile()) { - activeRequestList[i]->Read(); - if (activeRequestList[i]->IsFinished()) - MoveToFinishedList(activeRequestList[i]); - handled = true; + match = activeRequestList[i]; break; } } requestMutex.Unlock(); + + // call Read() after releasing the mutex + if (match) { + match->Read(); + if (match->IsFinished()) + MoveToFinishedList(match); + } } - if (!handled) { + if (!match) { webvi_perform(webvi, fd, WEBVI_SELECT_READ, &running_handles); check_done = true; } -- cgit v1.2.3