summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2019-03-22 18:27:13 +0000
committercheloha <cheloha@cvs.openbsd.org>2019-03-22 18:27:13 +0000
commit17bb3000ad28849dfb47fcfbd289d7dee44448d8 (patch)
treebae26d529b5a0fa69a9b44db0cf9100932c00672 /usr.bin
parent94d29fd871436b925bd74866e2ea66ad5ecaed94 (diff)
Move adjtimedelta into the timehands.
adjtimedelta is 64-bit and thus can't be read/written atomically on all architectures. Because it can be modified from tc_windup() and ntp_update_second() we need a way to ensure safe reads/writes for adjtime(2) callers. One solution is to move it into the timehands and adopt the lockless read protocol we now use for the system boot time and uptime. So make new_adjtimedelta an argument to tc_windup() and add a lockless read loop to tc_adjtime(). With adjtimedelta stored in the timehands we can now simply pass a timehands pointer to ntp_update_second(). This makes ntp_update_second() safer as we're using the timehands' timecounter pointer instead of the mutable global timecounter pointer. Lots of input from mpi@ and visa@. ok visa@
Diffstat (limited to 'usr.bin')
0 files changed, 0 insertions, 0 deletions