Add a sched_yeild in tocket lock test..

This commit is contained in:
Nils O. Selåsdal
2014-06-25 19:53:46 +02:00
parent 777a745428
commit c949961e77
+1
View File
@@ -18,6 +18,7 @@ static void *update_thread(void *arg)
struct ThreadArg *targ = arg; struct ThreadArg *targ = arg;
for (i = 0; i < targ->rounds; i++) { for (i = 0; i < targ->rounds; i++) {
uc_ticket_lock(&lock); uc_ticket_lock(&lock);
sched_yield();
g_counter++; g_counter++;
uc_ticket_unlock(&lock); uc_ticket_unlock(&lock);
} }