diff options
author | Will Deacon <will.deacon@arm.com> | 2017-11-17 18:53:09 +0000 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-11-17 18:53:09 +0000 |
commit | 1764a4f65c72645bcdfbab14a30b782efc6ea8ae (patch) | |
tree | 0ad82b6ff1d30e708cc08b5c71b277d69aa0ff3a | |
parent | bfb15e4b224ca317718828fd3ece3d99dc033896 (diff) | |
download | qrwlock-rmem-1764a4f65c72645bcdfbab14a30b782efc6ea8ae.tar.gz |
Increase number of threads
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | main.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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(); } |