diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-05-11 16:51:10 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-05-24 07:55:36 -0400 |
commit | a7e6a8cf51e567878ef2a78b184892755969223c (patch) | |
tree | 775abf26605f415c3551d4bf05536888474e293c /drivers/gpu/nvgpu/common/linux | |
parent | b03afb6d5c4bbca5a26cc95027491c816e5e1f6d (diff) |
gpu: nvgpu: Add query nvgpu_thread_is_running
Add query nvgpu_thread_is_running(). It returns true if thread has
already been started.
JIRA NVGPU-14
Change-Id: If3bed6f9ffe181703134ae1b92b0b275db364195
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1480257
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/thread.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/thread.c b/drivers/gpu/nvgpu/common/linux/thread.c index d37b2a10..ef783bbe 100644 --- a/drivers/gpu/nvgpu/common/linux/thread.c +++ b/drivers/gpu/nvgpu/common/linux/thread.c | |||
@@ -34,9 +34,15 @@ int nvgpu_thread_create(struct nvgpu_thread *thread, | |||
34 | void nvgpu_thread_stop(struct nvgpu_thread *thread) | 34 | void nvgpu_thread_stop(struct nvgpu_thread *thread) |
35 | { | 35 | { |
36 | kthread_stop(thread->task); | 36 | kthread_stop(thread->task); |
37 | thread->task = NULL; | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | bool nvgpu_thread_should_stop(struct nvgpu_thread *thread) | 40 | bool nvgpu_thread_should_stop(struct nvgpu_thread *thread) |
40 | { | 41 | { |
41 | return kthread_should_stop(); | 42 | return kthread_should_stop(); |
42 | }; | 43 | }; |
44 | |||
45 | bool nvgpu_thread_is_running(struct nvgpu_thread *thread) | ||
46 | { | ||
47 | return thread->task != NULL; | ||
48 | }; | ||