staticintVibeOSKernelTimerProc(void* data){intnActuatorNotPlaying;inti;intbReachEndBuffer =0;while(!kthread_should_stop()) {if(g_bTimerThreadStarted) {/* Block until we get woken up by timer tick *//* . only do this if we're not exiting entirely */wait_for_completion(&g_tspCompletion...
kthread_should_stop()返回should_stop标志。它用于创建的线程检查结束标志,并决定是否退出。线程完全可以在完成自己的工作后主动结束,不需等待should_stop标志。该函数定义在include/linux/kthread.h中,与其相关的还有:struct task_struct kthread_run(int (*threadfn)(void *data), void *data,c...
When using kthreads that call into svc_recv, we want to make sure that they do not block there for a long time when we're trying to take down the kthread. This patch changes svc_recv() to check kthread_should_stop() at the same places that it checks to see if it's signalled()...