Can I call kthread_should_stop() from user-space tasks?
Hi,
is it permissible to call kthread_should_stop() from normal user-space tasks (looking at kthread.c I suppose not), and if not, is there a way to find out whether the current task is a kthread?
Reason I'm asking, I have a function that's called from both kthreads and user-space tasks which calls wait_event_interruptible(). If it's a kthread I want to add "|| kthread_should_stop()" to the condition so it can be stopped with kthread_stop() while waiting, but of course I don't want to break user-space tasks by calling kthread_should_stop() if it's invalid.