mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
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
This commit is contained in:
committed by
mobile promotions
parent
b03afb6d5c
commit
a7e6a8cf51
@@ -34,9 +34,15 @@ int nvgpu_thread_create(struct nvgpu_thread *thread,
|
|||||||
void nvgpu_thread_stop(struct nvgpu_thread *thread)
|
void nvgpu_thread_stop(struct nvgpu_thread *thread)
|
||||||
{
|
{
|
||||||
kthread_stop(thread->task);
|
kthread_stop(thread->task);
|
||||||
|
thread->task = NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool nvgpu_thread_should_stop(struct nvgpu_thread *thread)
|
bool nvgpu_thread_should_stop(struct nvgpu_thread *thread)
|
||||||
{
|
{
|
||||||
return kthread_should_stop();
|
return kthread_should_stop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool nvgpu_thread_is_running(struct nvgpu_thread *thread)
|
||||||
|
{
|
||||||
|
return thread->task != NULL;
|
||||||
|
};
|
||||||
|
|||||||
@@ -59,4 +59,13 @@ void nvgpu_thread_stop(struct nvgpu_thread *thread);
|
|||||||
*/
|
*/
|
||||||
bool nvgpu_thread_should_stop(struct nvgpu_thread *thread);
|
bool nvgpu_thread_should_stop(struct nvgpu_thread *thread);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nvgpu_thread_is_running - Query if thread is running
|
||||||
|
*
|
||||||
|
* @thread
|
||||||
|
*
|
||||||
|
* Return true if thread is started.
|
||||||
|
*/
|
||||||
|
bool nvgpu_thread_is_running(struct nvgpu_thread *thread);
|
||||||
|
|
||||||
#endif /* __NVGPU_THREAD_H__ */
|
#endif /* __NVGPU_THREAD_H__ */
|
||||||
|
|||||||
Reference in New Issue
Block a user