Cosmetic fixes in spinlock
This commit is contained in:
parent
f1f480251c
commit
f48e74bebe
1 changed files with 2 additions and 2 deletions
|
@ -58,8 +58,8 @@ void acquire(struct spinlock *lk) {
|
||||||
panic("acquire");
|
panic("acquire");
|
||||||
|
|
||||||
// Spin until aquired. See file header for details
|
// Spin until aquired. See file header for details
|
||||||
while (__sync_lock_test_and_set(&lk->locked, 1) != 0) {
|
while (__sync_lock_test_and_set(&lk->locked, 1) != 0);
|
||||||
}
|
|
||||||
__sync_synchronize(); // No loads/stores after this point
|
__sync_synchronize(); // No loads/stores after this point
|
||||||
|
|
||||||
// Record info about lock acquisition for holding() and debugging.
|
// Record info about lock acquisition for holding() and debugging.
|
||||||
|
|
Loading…
Add table
Reference in a new issue