Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] lock handling in sections.c



hello,

I found this code in sections.c (1.3.16):

           bool DeviceHasLock = device->HasLock();
           if (!DeviceHasLock)
              cCondWait::SleepMs(100);

I wonder why lock is not checked again after the sleep...

I have had some problems with the budget after an EPG scan, and my
preliminary tests look like the attached patch might actually help.
The patch is against 1.3.14 or 16, the files are the same in both of
them.

yours,
		Jouni

--- ../vdr-1.3.14/sections.c    2004-10-24 14:05:12.000000000 +0300
+++ sections.c  2004-12-22 13:32:26.000000000 +0200
@@ -184,9 +184,12 @@
         Unlock();
 
         if (poll(pfd, NumFilters, 1000) > 0) {
-           bool DeviceHasLock = device->HasLock();
-           if (!DeviceHasLock)
-              cCondWait::SleepMs(100);
+         int round=0; // jouninlisays
+         bool DeviceHasLock;
+         while (((DeviceHasLock = device->HasLock())==false) && 
+                (round++ < 20)) {
+           cCondWait::SleepMs(100);
+         }
            for (int i = 0; i < NumFilters; i++) {
                if (pfd[i].revents & POLLIN) {
                   cFilterHandle *fh = NULL;






Home | Main Index | Thread Index