summaryrefslogtreecommitdiff
path: root/kern/sref.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-09-02 16:06:54 +0200
committerRichard Braun <rbraun@sceen.net>2017-09-02 16:06:54 +0200
commit7ded1b60d46d8582be0d86cd7176048bcfe30ccf (patch)
tree3b1ed96ad276c6aeff56c58380e59e643559e9c4 /kern/sref.c
parent1469ce26e2e58082fd4bbb343cad60f2d696a641 (diff)
kern/thread: new preemption control macros
These new macros take care of disabling/restoring interrupts in the appropriate order.
Diffstat (limited to 'kern/sref.c')
-rw-r--r--kern/sref.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kern/sref.c b/kern/sref.c
index 95daeb0..dd81ca6 100644
--- a/kern/sref.c
+++ b/kern/sref.c
@@ -798,15 +798,13 @@ sref_manage(void *arg)
cache = arg;
for (;;) {
- thread_preempt_disable();
- cpu_intr_save(&flags);
+ thread_preempt_disable_intr_save(&flags);
while (!sref_cache_is_dirty(cache)) {
thread_sleep(NULL, cache, "sref");
}
- cpu_intr_restore(flags);
- thread_preempt_enable();
+ thread_preempt_enable_intr_restore(flags);
sref_cache_flush(cache, &queue);
sref_review(&queue);