Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
Kernel
SMP
这个!!current_thread.cpus_lock_nest啥
发布于 2019-04-09 16:23:58 浏览:1181
订阅该版
rt_enter_crtical中这个`!!current_thread->cpus_lock_nest`啥? ```c /** * This function will lock the thread scheduler. */ #ifdef RT_USING_SMP void rt_enter_critical(void) { register rt_base_t level; struct rt_thread *current_thread; /* disable interrupt */ level = rt_hw_local_irq_disable(); current_thread = rt_cpu_self()->current_thread; /* * the maximal number of nest is RT_UINT16_MAX, which is big * enough and does not check here */ /* lock scheduler for all cpus */ if (current_thread->scheduler_lock_nest == !!current_thread->cpus_lock_nest) { rt_hw_spin_lock(&_rt_critical_lock); } /* lock scheduler for local cpu */ current_thread->scheduler_lock_nest ++; /* enable interrupt */ rt_hw_local_irq_enable(level); } ```
查看更多
3
个回答
默认排序
按发布时间排序
云南白药糕
2022-03-21
这家伙很懒,什么也没写!
这样写的话非0的值最终会变为1。 c语言的true一般是用1定义的。这样用`!!(非零)= = true`就不会有问题了。
hwx628
2019-04-09
这家伙很懒,什么也没写!
对一个uint16的值取反再取反?
撰写答案
登录
注册新账号
关注者
0
被浏览
1.2k
关于作者
hwx628
这家伙很懒,什么也没写!
提问
5
回答
12
被采纳
0
关注TA
发私信
相关问题
1
请教cpu使用率分析
2
选择FreeRTOS, 还是RT-Thread。
3
thread heap stack overflow ?
4
rtt消息队列delay问题
5
释放被删除线程的内存地方在哪里啊
6
请教:各线程结束后,释放其中的内存的连续性问题
7
STM32F103中断关于信号量、邮箱问题
8
RTT中的线程栈大小如何控制
9
关于线程由执行态变为挂起态的代码实现,,,
10
rt_malloc(rt_size_t size)内存分配函数最小分配尺寸问题
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
机器人操作系统 (ROS2) 和 RT-Thread 通信
4
国产MCU移植系列教程汇总,欢迎查看!
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
NXP MCXN236测评-硬件I2C
2
【NXP-MCXA153】RTT UART2驱动添加
3
搞了个 WEB 串口终端,简单分享下
4
雅特力单片机开发工具
5
NXP MCXN236测评——rt-thread中配置启动PWM
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
Bootloader
AT
Hardfault
ART-Pi
CAN总线
FinSH
USB
文件系统
DMA
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
ESP8266
rt-smart
ota在线升级
WIZnet_W5500
I2C_IIC
UART
flash
packages_软件包
cubemx
freemodbus
PWM
潘多拉开发板_Pandora
定时器
BSP
ADC
flashDB
中断
编译报错
Debug
socket
GD32
msh
keil_MDK
at_device
SFUD
ulog
C++_cpp
MicroPython
本月问答贡献
出出啊
1508
个答案
341
次被采纳
小小李sunny
1431
个答案
289
次被采纳
张世争
751
个答案
163
次被采纳
crystal266
546
个答案
159
次被采纳
whj467467222
1221
个答案
148
次被采纳
本月文章贡献
出出啊
1
篇文章
1
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
3
篇文章
5
次点赞
crystal266
2
篇文章
1
次点赞
whj467467222
2
篇文章
2
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部