From a7e6a8cf51e567878ef2a78b184892755969223c Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 11 May 2017 13:51:10 -0700 Subject: 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 Reviewed-on: http://git-master/r/1480257 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker Reviewed-by: Alex Waterman Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/linux/thread.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/common') 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, void nvgpu_thread_stop(struct nvgpu_thread *thread) { kthread_stop(thread->task); + thread->task = NULL; }; bool nvgpu_thread_should_stop(struct nvgpu_thread *thread) { return kthread_should_stop(); }; + +bool nvgpu_thread_is_running(struct nvgpu_thread *thread) +{ + return thread->task != NULL; +}; -- cgit v1.2.2