Platform::wait(): Never wait on zero delay
This commit is contained in:
parent
d72711e7cb
commit
e42a606ae8
1 changed files with 3 additions and 0 deletions
|
@ -588,6 +588,9 @@ void platform::wait(uint64_t usec) throw()
|
||||||
internal_run_queues(true);
|
internal_run_queues(true);
|
||||||
if(queue_function_run)
|
if(queue_function_run)
|
||||||
reload_lua_timers();
|
reload_lua_timers();
|
||||||
|
//If usec is 0, never wait (waitleft can be nonzero if time counting screws up).
|
||||||
|
if(!usec)
|
||||||
|
return;
|
||||||
now = get_utime();
|
now = get_utime();
|
||||||
uint64_t waitleft = 0;
|
uint64_t waitleft = 0;
|
||||||
waitleft = (now < continue_time) ? (continue_time - now) : 0;
|
waitleft = (now < continue_time) ? (continue_time - now) : 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue