MT#40962 increase idle sleep time

If there are no sessions then it makes no senes to process ticks in real
time. Sleep up to 0.5 seconds in that case. When sessions are added we
are immediately woken up through the conditional variable. Only setting
the shutdown flag would not wake up the thread, but a sleep time of half
a second should be an acceptable delay for shutdowns.

Change-Id: I5aa43382248754ff8dec811038998cf636579734
mr12.3.1
Richard Fuchs 3 years ago
parent 1a0b944d93
commit 096a1f31a5

@ -249,8 +249,12 @@ void AmMediaProcessorThread::run()
uint64_t diff = next_tick - now;
if(diff)
events.waitForEventTimed(diff / 1000);
if(diff) {
if (sessions.empty())
events.waitForEventTimed(500); // 0.5 s
else
events.waitForEventTimed(diff / 1000);
}
}
events.processEvents();

Loading…
Cancel
Save