summaryrefslogtreecommitdiff
path: root/spinlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'spinlock.h')
-rw-r--r--spinlock.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/spinlock.h b/spinlock.h
index fdda016..f6a69b7 100644
--- a/spinlock.h
+++ b/spinlock.h
@@ -1,4 +1,4 @@
-// Mutual exclusion lock.
+// Mutual exclusion lock for short code fragments
struct spinlock {
uint locked; // Is the lock held?
@@ -9,3 +9,8 @@ struct spinlock {
// that locked the lock.
};
+// Lock that maybe held across sleeps
+struct sleeplock {
+ uint locked; // Is the lock held?
+};
+