
C
菜菜的阿庄
这个作者很懒,什么都没留下…
展开
-
C code——kthread_create 创建线程
#include <stdio.h> #include <linux/sched.h> static struct task_struct *test_task = NULL; static int test_monitor_process(void *data) { while(!kthread_should_stop()) { printf("hhhh\n"); } return 0; } static int __init原创 2022-04-14 17:23:39 · 556 阅读 · 0 评论 -
C 数据结构 —— 先入先出
创建相关节点: #include <stdio.h> #include <linux/mutex.h> struct fifo_node { int some_data; struct fifo_node *next; }; struct fifo_queue { struct mutex lock; struct fifo_node *head; struct fifo_node *tail; }; static fifo_queue原创 2022-04-09 15:46:03 · 1354 阅读 · 0 评论