Skip to content

Commit

Permalink
Threads: Fix bug for SRTP and Log thread nanosleep.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Apr 26, 2021
1 parent 88165ba commit e3686a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trunk/src/app/srs_app_threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ srs_error_t SrsAsyncLogManager::do_start()
// this is a system thread, not a coroutine.
timespec tv = {0};
tv.tv_sec = interval_ / SRS_UTIME_SECONDS;
tv.tv_nsec = (interval_ % SRS_UTIME_MILLISECONDS) * 1000;
tv.tv_nsec = (interval_ % SRS_UTIME_SECONDS) * 1000;
nanosleep(&tv, NULL);
}

Expand Down Expand Up @@ -684,7 +684,7 @@ srs_error_t SrsAsyncSRTPManager::do_start()
// TODO: FIXME: Maybe we should use cond wait?
timespec tv = {0};
tv.tv_sec = interval / SRS_UTIME_SECONDS;
tv.tv_nsec = (interval % SRS_UTIME_MILLISECONDS) * 1000;
tv.tv_nsec = (interval % SRS_UTIME_SECONDS) * 1000;
nanosleep(&tv, NULL);
}

Expand Down

0 comments on commit e3686a4

Please sign in to comment.