At least wait 1ms when <1ms, to avoid epoll_wait spin loop. 4.0.66

pull/2199/head
winlin 4 years ago
parent 5eafcea895
commit 9ada516e98

@ -155,6 +155,8 @@ For previous versions, please read:
## V4 changes
* v4.0, 2021-02-04, At least wait 1ms when <1ms, to avoid epoll_wait spin loop. 4.0.66
* v4.0, 2021-01-31, Enable -std=c++11 by default. 4.0.65
* v4.0, 2021-01-25, Enable --nasm and --srtp-asm by default for performance. 4.0.64
* v4.0, 2021-01-20, Support HTTP-FLV and HLS for srs-player by H5. 4.0.63
* v4.0, 2021-01-08, HTML5 video tag resolution adaptive. 4.0.59

@ -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()) {

@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION4_HPP
#define SRS_CORE_VERSION4_HPP
#define SRS_VERSION4_REVISION 65
#define SRS_VERSION4_REVISION 66
#endif

Loading…
Cancel
Save