4787| 6
|
请教一个Free RTOS下使用全局变量的问题 |
100金钱
最佳答案OS会导致任务切换你知道的吧?全局变量A在任务A中“使用中”任务切换至B,B中修改了全局变量A的值再切换回任务A接着使用全局变量A,此时的全局变量的值已经不是原来的值而是被B修改过了。你在任务A中得出了错误的结果就因为你没有做保护使得任务B在全局变量使用过程中(任务A使用中)修改了变量的值。
| ||
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
| ||
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
| ||
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
|手机版|OpenEdv-开源电子网
( 粤ICP备12000418号-1 )
GMT+8, 2025-7-2 05:49
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网