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 968d9c4..01226a7 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();
                }