Commit 04d0b327 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/thread: detect sleeping call with preemption disabled



Sleeping voluntarily with EVL preemption disabled is a bug. Add the
proper assertion to detect this.
Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
parent 8cb37040
......@@ -16,8 +16,6 @@
#include <linux/atomic.h>
#include <linux/spinlock.h>
#include <linux/ptrace.h>
#include <evl/list.h>
#include <evl/lock.h>
#include <evl/stat.h>
#include <evl/init.h>
#include <evl/timer.h>
......
......@@ -29,7 +29,6 @@
#include <evl/clock.h>
#include <evl/stat.h>
#include <evl/assert.h>
#include <evl/lock.h>
#include <evl/thread.h>
#include <evl/memory.h>
#include <evl/file.h>
......@@ -490,6 +489,9 @@ void evl_sleep_on_locked(ktime_t timeout, enum evl_tmode timeout_mode,
struct evl_rq *rq = curr->rq;
unsigned long oldstate;
/* Sleeping while preemption is disabled is a bug. */
EVL_WARN_ON(CORE, evl_preempt_count() != 0);
assert_hard_lock(&curr->lock);
assert_hard_lock(&rq->lock);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment