gettime: improve cpu clock test
authorJens Axboe <axboe@kernel.dk>
Tue, 17 Oct 2017 18:11:44 +0000 (12:11 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 17 Oct 2017 18:11:44 +0000 (12:11 -0600)
commita250edd0678ac6aef34bfbd01423a7b87a1d5f8d
treed50b43955067fad087627caa605d539928d7f52e
parentc13a60ce72aaf5b07b93977ab86e7522d167ec28
gettime: improve cpu clock test

We're missing a synchronization before reading and comparing
with the current *t->seq in the loop. Rewrite the loop to
use compare-and-exchange for the increment, and ensure that
we have the proper synchronization inserted. This should both
be faster and more reliable.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
configure
gettime.c