Commit 69973913 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/thread: add evl_current_kthread()



Returns the current kthread descriptor or NULL if another thread
context is running. CAUTION: does not account for IRQ context.
Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
parent 4f82c32b
......@@ -397,4 +397,13 @@ int evl_join_kthread(struct evl_kthread *kthread,
return evl_join_thread(&kthread->thread, uninterruptible);
}
static inline struct evl_kthread *
evl_current_kthread(void)
{
struct evl_thread *t = evl_current();
return !t || t->state & T_USER ? NULL :
container_of(t, struct evl_kthread, thread);
}
#endif /* !_EVL_THREAD_H */
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