1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #2369, #1708, #1941: Check errno when close fd or stop thread

This commit is contained in:
winlin 2021-10-31 18:16:33 +08:00
parent 60ab81a5c7
commit ab5079909d
5 changed files with 57 additions and 4 deletions

View file

@ -202,7 +202,16 @@ void SrsFastCoroutine::stop()
if (trd) {
void* res = NULL;
int r0 = st_thread_join((st_thread_t)trd, &res);
srs_assert(!r0);
if (r0) {
// By st_thread_join
if (errno == EINVAL) srs_assert(!r0);
if (errno == EDEADLK) srs_assert(!r0);
// By st_cond_timedwait
if (errno == EINTR) srs_assert(!r0);
if (errno == ETIME) srs_assert(!r0);
// Others
srs_assert(!r0);
}
srs_error_t err_res = (srs_error_t)res;
if (err_res != srs_success) {