X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=test_rwlock.c;h=1c29d73839adaec693c53a2315c8e0cd8a2a1be0;hp=ef3ce2c73bb49c14571703c9d9d6eb94e5ba164a;hb=59d5a40624428364374c306409979155beddfaac;hpb=49a26f58526c3ff15e34087f932298a543c25269 diff --git a/test_rwlock.c b/test_rwlock.c index ef3ce2c..1c29d73 100644 --- a/test_rwlock.c +++ b/test_rwlock.c @@ -127,7 +127,7 @@ void *thr_reader(void *_count) assert(test_array.a == 8); pthread_rwlock_unlock(&lock); nr_reads++; - if (!test_duration_read()) + if (unlikely(!test_duration_read())) break; } @@ -156,9 +156,9 @@ void *thr_writer(void *_count) test_array.a = 8; pthread_rwlock_unlock(&lock); nr_writes++; - if (!test_duration_write()) + if (unlikely(!test_duration_write())) break; - if (wdelay) + if (unlikely(wdelay)) usleep(wdelay); }