summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntti Ajanki <antti.ajanki@iki.fi>2010-08-26 20:16:41 +0300
committerAntti Ajanki <antti.ajanki@iki.fi>2010-08-26 20:16:41 +0300
commit41537b37ee2a1f6521e98653d6147f71640ebe4d (patch)
treee9f8d7cac85f2f064abfb2c0a5f5d505fdb3ed1b /src
parent79fdf43317dc87182dc75e23e368558fbb3fce47 (diff)
downloadvdr-plugin-webvideo-41537b37ee2a1f6521e98653d6147f71640ebe4d.tar.gz
vdr-plugin-webvideo-41537b37ee2a1f6521e98653d6147f71640ebe4d.tar.bz2
release mutex before calling Read()
Diffstat (limited to 'src')
-rw-r--r--src/vdr-plugin/download.c16
1 files changed, 10 insertions, 6 deletions
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; i<activeRequestList.Size(); i++) {
if (fd == activeRequestList[i]->File()) {
- 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;
}