HasLock(): add timeout feature (#71)
This commit is contained in:
parent
55362a2db6
commit
ba0b04ba12
8
device.c
8
device.c
|
@ -448,6 +448,14 @@ void cSatipDevice::CloseDvr(void)
|
|||
bool cSatipDevice::HasLock(int timeoutMsP) const
|
||||
{
|
||||
debug16("%s (%d) [device %d]", __PRETTY_FUNCTION__, timeoutMsP, deviceIndexM);
|
||||
if (timeoutMsP > 0) {
|
||||
cTimeMs timer(timeoutMsP);
|
||||
while (!timer.TimedOut()) {
|
||||
if (pTunerM && pTunerM->HasLock())
|
||||
return true;
|
||||
cCondWait::SleepMs(100);
|
||||
}
|
||||
}
|
||||
return (pTunerM && pTunerM->HasLock());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue