projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Unlikely for tests
[urcu.git]
/
test_rwlock.c
diff --git
a/test_rwlock.c
b/test_rwlock.c
index 76156cb01064e335b729be9458f0fdd9a0720c16..1c29d73839adaec693c53a2315c8e0cd8a2a1be0 100644
(file)
--- a/
test_rwlock.c
+++ b/
test_rwlock.c
@@
-65,7
+65,7
@@
static volatile int test_go, test_stop;
static int wdelay;
static int wdelay;
-static struct test_array test_array = { 8 };
+static
volatile
struct test_array test_array = { 8 };
static unsigned long duration;
static unsigned long duration;
@@
-127,7
+127,7
@@
void *thr_reader(void *_count)
assert(test_array.a == 8);
pthread_rwlock_unlock(&lock);
nr_reads++;
assert(test_array.a == 8);
pthread_rwlock_unlock(&lock);
nr_reads++;
- if (
!test_duration_read(
))
+ if (
unlikely(!test_duration_read()
))
break;
}
break;
}
@@
-152,12
+152,13
@@
void *thr_writer(void *_count)
for (;;) {
pthread_rwlock_wrlock(&lock);
for (;;) {
pthread_rwlock_wrlock(&lock);
+ test_array.a = 0;
test_array.a = 8;
pthread_rwlock_unlock(&lock);
nr_writes++;
test_array.a = 8;
pthread_rwlock_unlock(&lock);
nr_writes++;
- if (
!test_duration_write(
))
+ if (
unlikely(!test_duration_write()
))
break;
break;
- if (
wdelay
)
+ if (
unlikely(wdelay)
)
usleep(wdelay);
}
usleep(wdelay);
}
This page took
0.023687 seconds
and
4
git commands to generate.