fix: handle precision_ms >= 1000 in delay_worker nanosleep (tv_nsec overflow)
This commit is contained in:
parent
6d4d8eb81d
commit
0107828a77
1 changed files with 5 additions and 1 deletions
|
|
@ -19,7 +19,11 @@ static void* delay_worker(void* args)
|
|||
|
||||
pthread_testcancel();
|
||||
{
|
||||
struct timespec ts = { 0, (long)mgr->precision_ms * 1000000L };
|
||||
long ms = (long)mgr->precision_ms;
|
||||
struct timespec ts = {
|
||||
.tv_sec = ms / 1000,
|
||||
.tv_nsec = (ms % 1000) * 1000000L,
|
||||
};
|
||||
nanosleep(&ts, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue