summaryrefslogtreecommitdiff
path: root/kern/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.h')
-rw-r--r--kern/thread.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/kern/thread.h b/kern/thread.h
index 21be2ab7..1542e7ae 100644
--- a/kern/thread.h
+++ b/kern/thread.h
@@ -367,6 +367,29 @@ thread_schedule(void)
}
/*
+ * Sleep queue lending functions.
+ */
+
+static inline struct sleepq *
+thread_sleepq_lend(void)
+{
+ struct sleepq *sleepq;
+
+ sleepq = thread_self()->priv_sleepq;
+ assert(sleepq != NULL);
+ thread_self()->priv_sleepq = NULL;
+ return sleepq;
+}
+
+static inline void
+thread_sleepq_return(struct sleepq *sleepq)
+{
+ assert(sleepq != NULL);
+ assert(thread_self()->priv_sleepq == NULL);
+ thread_self()->priv_sleepq = sleepq;
+}
+
+/*
* Migration control functions.
*
* Functions that change the migration state are implicit compiler barriers.