X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=test_perthreadlock.c;h=3684975eebf7c85312cd3a6a2322f88af03c022c;hp=7b6a65c8c6fb18a68531e13c19587e44aad6729c;hb=59d5a40624428364374c306409979155beddfaac;hpb=49a26f58526c3ff15e34087f932298a543c25269 diff --git a/test_perthreadlock.c b/test_perthreadlock.c index 7b6a65c..3684975 100644 --- a/test_perthreadlock.c +++ b/test_perthreadlock.c @@ -134,7 +134,7 @@ void *thr_reader(void *data) assert(test_array.a == 8); pthread_mutex_unlock(&per_thread_lock[tidx].lock); nr_reads++; - if (!test_duration_read()) + if (unlikely(!test_duration_read())) break; } @@ -168,9 +168,9 @@ void *thr_writer(void *data) pthread_mutex_unlock(&per_thread_lock[tidx].lock); } nr_writes++; - if (!test_duration_write()) + if (unlikely(!test_duration_write())) break; - if (wdelay) + if (unlikely(wdelay)) usleep(wdelay); }