linux kthread 线程

头文件: linux-3.18\include\linux\kthread.h

源文件:linux-3.18\kernel\kthread.c

创建线程

kthread_run(threadfn, data, namefmt)

 

判断线程是否停止

bool kthread_should_stop(void)

 

停止线程

int kthread_stop(struct task_struct *k)

 

linux-3.18\include\linux\wait.h

线程一般与等待队列结合使用

声明与初始化

 DECLARE_WAIT_QUEUE_HEAD(name)  

睡眠队列

wait_event_interruptible(wq, condition)

唤醒队列

wake_up_interruptible(&urdma_wait);

 

 

 

kthread_run(threadfn, data, namefmt)

 

posted @   cogitoergosum  阅读(161)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
历史上的今天:
2016-03-03 linux 驱动程序中断号的申请
点击右上角即可分享
微信分享提示