Add a sched_yeild in tocket lock test..
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user