userprog: use modulo
authorBrian Norris <banorris@uci.edu>
Mon, 21 May 2012 18:59:02 +0000 (11:59 -0700)
committerBrian Norris <banorris@uci.edu>
Mon, 21 May 2012 18:59:02 +0000 (11:59 -0700)
Increasing the number of loops is useless unless we have modulo here... I
don't know why this was changed by Subramanian.

userprog.c

index 0948f0bc395a5d103963e99d81592ac6e2307072..2854ddc4a6b73bdf366b63262ed63ff3c8911eff 100644 (file)
@@ -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);