如何使用spinlock要哪个头文件

如何使用spinlock要哪个头文件,第1张

在kernel2.4.20下面:

include <linux/spinlock.h>

spinlock_t mysiglock = SPIN_LOCK_UNLOCKED

unsigned int flags

再加上这个

#include <asm/system.h>

#include <linux/module.h>:模块

#include <linux/kernel.h>:内核

#include <linux/sched.h>:调度器

#include <linux/signal.h>:信号量

#include <linux/errno.h>:里面定义一些“错误”信息

#include <linux/fcntl.h>:file control

#include <linux/spinlock.h>:环行锁,实现临界区的互斥访问

其他的我不是很清楚,你可以去google一下.


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/yw/8742219.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-20
下一篇 2023-04-20

发表评论

登录后才能评论

评论列表(0条)

保存