112 int64_t prev_index = -1;
121 .tt_thread_index = thread_index,
122 .tt_prev_index = prev_index,
156 for (
i = b + 1;
i <=
c - 1; ++
i) {
182 for (
i = 0;
i < threads_nr; ++
i) {
187 "#%d_time_thread",
i);
191 for (
i = 0;
i < threads_nr; ++
i)
194 for (
i = 0;
i < threads_nr; ++
i) {
218 "number of out-of-sync errors = %lu, " 219 "maximum out-of-sync error = %lu ns",
224 "no out-of-sync errors found", threads_nr);
static void time_test_check(int64_t a, int64_t b, int64_t c)
int m0_thread_join(struct m0_thread *q)
struct m0_semaphore tth_start
const m0_time_t M0_TIME_NEVER
static void time_thread(int thread_index)
#define M0_LOG(level,...)
static m0_time_t tv(int index)
struct m0_ub_set m0_time_ub
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
m0_time_t m0_time(uint64_t secs, long ns)
void m0_ut_time_test(void)
static void ub_time_round(int unused)
m0_time_t m0_time_now(void)
static struct m0_addb2_callback c
static struct m0_thread t[8]
void m0_thread_fini(struct m0_thread *q)
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
static unsigned long err_nr
m0_time_t m0_time_add(const m0_time_t t1, const m0_time_t t2)
static int64_t m0_atomic64_get(const struct m0_atomic64 *a)
static struct time_test time_values[TIME_VALUES_NR]
static m0_time_t tv_prev(int index)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
m0_time_t m0_time_sub(const m0_time_t t1, const m0_time_t t2)
static struct m0_atomic64 time_index
static void time_test_mt_nr(int threads_nr)
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
struct m0_thread tth_thread
static void time_test_simple(void)
static struct time_test_thread time_threads[THREADS_NR_MAX]
static int64_t m0_atomic64_add_return(struct m0_atomic64 *a, int64_t d)
static void m0_atomic64_set(struct m0_atomic64 *a, int64_t num)
int m0_nanosleep(const m0_time_t req, m0_time_t *rem)