aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2017-11-17 18:53:09 +0000
committerWill Deacon <will.deacon@arm.com>2017-11-17 18:53:09 +0000
commit1764a4f65c72645bcdfbab14a30b782efc6ea8ae (patch)
tree0ad82b6ff1d30e708cc08b5c71b277d69aa0ff3a
parentbfb15e4b224ca317718828fd3ece3d99dc033896 (diff)
downloadqrwlock-rmem-1764a4f65c72645bcdfbab14a30b782efc6ea8ae.tar.gz
Increase number of threads
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.c b/main.c
index 1a0b22e..72659c8 100644
--- a/main.c
+++ b/main.c
@@ -11,21 +11,23 @@ static int count = 0;
static void writer(void)
{
arch_write_lock(&lock);
- count = 1;
+ count++;
barrier();
- count = 2;
+ count++;
arch_write_unlock(&lock);
}
static void reader(void)
{
arch_read_lock(&lock);
- assert(count != 1);
+ assert((count & 1) == 0);
arch_read_unlock(&lock);
}
void _start(void)
{
__rmem_thread_start(writer);
+ __rmem_thread_start(writer);
+ __rmem_thread_start(reader);
reader();
}