mirror of https://github.com/aredn/aredn.git
Improve 'wait_for_ticks' handling of system clock changes (#1035)
This commit is contained in:
parent
a388adaa79
commit
bd26116e45
|
@ -51,7 +51,16 @@ if nixio.sysinfo().totalram < 32 * 1024 * 1024 then
|
||||||
end
|
end
|
||||||
|
|
||||||
function wait_for_ticks(ticks)
|
function wait_for_ticks(ticks)
|
||||||
coroutine.yield(ticks)
|
local when = nixio.sysinfo().uptime + ticks
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
ticks = when - nixio.sysinfo().uptime
|
||||||
|
if ticks > 0 then
|
||||||
|
coroutine.yield(ticks)
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function exit_app()
|
function exit_app()
|
||||||
|
|
Loading…
Reference in New Issue