test: mutextest: add thread yield point
authorBrian Norris <banorris@uci.edu>
Wed, 3 Apr 2013 00:28:59 +0000 (17:28 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 3 Apr 2013 00:28:59 +0000 (17:28 -0700)
test/mutextest.cc

index 968d9c4816533cd30d14e2bf9134e0c9a8c644a7..01226a71d3462fb20d546a1dffc16024e7112c2e 100644 (file)
@@ -17,7 +17,7 @@ static void a(void *obj)
                        m->unlock();
                } else {
                        while(!m->try_lock())
-                               ;
+                               thrd_yield();
                        store_32(&shareddata,(unsigned int)i);
                        m->unlock();
                }