X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=test_perthreadlock.c;h=3684975eebf7c85312cd3a6a2322f88af03c022c;hb=59d5a40624428364374c306409979155beddfaac;hp=7b6a65c8c6fb18a68531e13c19587e44aad6729c;hpb=2b4e41252ca7ad279d2aa91f2a011b36aa56b224;p=urcu.git 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); }