Increase number of threads
Signed-off-by: Will Deacon <will.deacon@arm.com>
diff --git a/main.c b/main.c
index 1a0b22e..72659c8 100644
--- a/main.c
+++ b/main.c
@@ -11,21 +11,23 @@
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();
}