From d4253111e600d9e6d1c3469bbc5832d0d79ee89a Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 21 May 2012 11:59:02 -0700 Subject: [PATCH] userprog: use modulo Increasing the number of loops is useless unless we have modulo here... I don't know why this was changed by Subramanian. --- userprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/userprog.c b/userprog.c index 0948f0b..2854ddc 100644 --- a/userprog.c +++ b/userprog.c @@ -14,7 +14,7 @@ static void a(atomic_int *obj) for (i = 0; i < 2; i++) { printf("Thread %d, loop %d\n", thrd_current(), i); - switch (i ) { + switch (i % 2) { case 1: ret = atomic_load(obj); printf("Read value: %d\n", ret); -- 2.34.1