X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Ftest_perthreadlock.c;h=fa9c89a5e560e452f9768ef90fffbd795f16cb84;hp=6c7114ca059096f98340ce7f815a7b7a8fa40bca;hb=a0b7f7ea3fc3339a1c42caffd53ce9f056e5b901;hpb=de10a5858ea0638c9059bb3315794ccb1401f404 diff --git a/tests/test_perthreadlock.c b/tests/test_perthreadlock.c index 6c7114c..fa9c89a 100644 --- a/tests/test_perthreadlock.c +++ b/tests/test_perthreadlock.c @@ -209,11 +209,11 @@ void *thr_reader(void *data) for (;;) { pthread_mutex_lock(&per_thread_lock[tidx].lock); assert(test_array.a == 8); - if (unlikely(rduration)) + if (caa_unlikely(rduration)) loop_sleep(rduration); pthread_mutex_unlock(&per_thread_lock[tidx].lock); nr_reads++; - if (unlikely(!test_duration_read())) + if (caa_unlikely(!test_duration_read())) break; } @@ -245,15 +245,15 @@ void *thr_writer(void *data) } test_array.a = 0; test_array.a = 8; - if (unlikely(wduration)) + if (caa_unlikely(wduration)) loop_sleep(wduration); for (tidx = (long)nr_readers - 1; tidx >= 0; tidx--) { pthread_mutex_unlock(&per_thread_lock[tidx].lock); } nr_writes++; - if (unlikely(!test_duration_write())) + if (caa_unlikely(!test_duration_write())) break; - if (unlikely(wdelay)) + if (caa_unlikely(wdelay)) loop_sleep(wdelay); }