summaryrefslogtreecommitdiff
path: root/kern/work.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/work.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/work.c')
-rw-r--r--kern/work.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kern/work.c b/kern/work.c
index 46475229..c0eb0bb1 100644
--- a/kern/work.c
+++ b/kern/work.c
@@ -217,8 +217,7 @@ work_pool_acquire(struct work_pool *pool, unsigned long *flags)
if (pool->flags & WORK_PF_GLOBAL) {
spinlock_lock_intr_save(&pool->lock, flags);
} else {
- thread_preempt_disable();
- cpu_intr_save(flags);
+ thread_preempt_disable_intr_save(flags);
}
}
@@ -228,8 +227,7 @@ work_pool_release(struct work_pool *pool, unsigned long flags)
if (pool->flags & WORK_PF_GLOBAL) {
spinlock_unlock_intr_restore(&pool->lock, flags);
} else {
- cpu_intr_restore(flags);
- thread_preempt_enable();
+ thread_preempt_enable_intr_restore(flags);
}
}