xv6-labs-2024-solution/kernel/spinlock.h
Frans Kaashoek 8702675076 lock lab
2024-10-25 09:21:45 -04:00

14 lines
242 B
C

// Mutual exclusion lock.
struct spinlock {
uint locked; // Is the lock held?
// For debugging:
char *name; // Name of lock.
struct cpu *cpu; // The cpu holding the lock.
#ifdef LAB_LOCK
int nts;
int n;
#endif
};