Mailing List archive

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

[vdr] Re: vdr 1.3.18 cCondWait::SleepMs



Ludwig Nussel wrote:
Luca Olivetti wrote:

Ludwig Nussel wrote:

             else
-                 cCondWait::SleepMs(1); // this keeps the CPU load low
+                 playMode_condition.Wait(mutex);
this line is under LOCK_THREAD....


             }

          // Store the frame in the buffer:
@@ -521,6 +523,7 @@ void cDvbPlayer::Play(void)
    DevicePlay();
    playMode = pmPlay;
    playDir = pdForward;
+     playMode_condition.Broadcast();
..as is this one. Am I misunderstanding LOCK_THREAD or is this creating
a deadlock? (just asking, didn't test it). OTOH if it works it would
avoid calling PlayPes in pmStill mode (but not in pmPause).

The trick is that the condition variable unlocks the mutex while it
waits for the broadcast.
Ahh, I see it now that cThreadLock uses cThread::Lock that in turn uses "mutex" for the lock.

Bye

--
- Yo también quiero una Europa libre de Patentes de Software -
- I want a Software Patents Free Europe too! And you? -
---------------------------------------------------------------
EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es

Attachment: signature.asc
Description: OpenPGP digital signature


Home | Main Index | Thread Index