lkml.org 
[lkml]   [2011]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectCan I call kthread_should_stop() from user-space tasks?
From
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.


\
 
 \ /
  Last update: 2011-10-21 16:59    [W:0.411 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site