diff options
Diffstat (limited to 'spinlock.c')
-rw-r--r-- | spinlock.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -14,6 +14,8 @@ acquire_spinlock(uint32_t* lock) if (*lock == cpu_id) return; + + lapic_disableintr(); while ( cmpxchg(LOCK_FREE, cpu_id, lock) != cpu_id ) { ; } // cprintf ("acquired: %d\n", cpu_id); } @@ -26,6 +28,7 @@ release_spinlock(uint32_t* lock) if (*lock != cpu_id) panic("release_spinlock: releasing a lock that i don't own\n"); *lock = LOCK_FREE; + lapic_enableintr(); } void |