|
@@ -13,7 +13,7 @@ void __lockfile(FILE *f)
|
|
f->lockcount++;
|
|
f->lockcount++;
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- while (f->lock || a_cas(&f->lock, 0, tid))
|
|
|
|
|
|
+ while (a_cas(&f->lock, 0, tid))
|
|
if (spins) spins--, a_spin();
|
|
if (spins) spins--, a_spin();
|
|
else syscall(SYS_sched_yield);
|
|
else syscall(SYS_sched_yield);
|
|
f->lockcount = 1;
|
|
f->lockcount = 1;
|