mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
At least wait 1ms when <1ms, to avoid epoll_wait spin loop. 4.0.66
This commit is contained in:
parent
19a7c7682e
commit
cfddc8f266
3 changed files with 7 additions and 1 deletions
5
trunk/3rdparty/st-srs/event.c
vendored
5
trunk/3rdparty/st-srs/event.c
vendored
|
@ -1210,6 +1210,11 @@ ST_HIDDEN void _st_epoll_dispatch(void)
|
|||
} else {
|
||||
min_timeout = (_ST_SLEEPQ->due <= _ST_LAST_CLOCK) ? 0 : (_ST_SLEEPQ->due - _ST_LAST_CLOCK);
|
||||
timeout = (int) (min_timeout / 1000);
|
||||
|
||||
// At least wait 1ms when <1ms, to avoid epoll_wait spin loop.
|
||||
if (min_timeout > 0 && timeout == 0) {
|
||||
timeout = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (_st_epoll_data->pid != getpid()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue