What is the effect of changing system time on sleeping threads?

后端 未结 2 1672
不知归路
不知归路 2021-01-12 20:15

If you take a look at the clock_gettime() function, which is available in all BSDs and is actually defined as part of the POSIX standard, you see that there is support for a

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 20:49

    The thread will be checking on an internal counter that is set to the duration of the sleep not to the end point of the sleep. The internal counter used has nothing to do with the current system time and therefore will not be affected if any changes occur in the system time.

提交回复
热议问题