Skip to content

Commit

Permalink
tests: Fix check loop mt test
Browse files Browse the repository at this point in the history
test_th was accesed both by main thread and loop_timer thread resulting in
failure. Fix is to access test_tht in loop_timer thread.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
  • Loading branch information
jfriesse committed Mar 17, 2021
1 parent fee1cf5 commit 74d46f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/check_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static void *loop_timer_thread(void *arg)
res = qb_loop_timer_add(l, QB_LOOP_LOW, 5*QB_TIME_NS_IN_MSEC, l, one_shot_tmo, &test_tht);
ck_assert_int_eq(res, 0);

res = qb_loop_timer_is_running(l, test_th);
res = qb_loop_timer_is_running(l, test_tht);
ck_assert_int_eq(res, QB_TRUE);

sleep(5);
Expand Down

0 comments on commit 74d46f0

Please # to comment.