Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
堆_heap_动态内存管理
(tid != RT_NULL) assertion failed at function:rt_application_init,
发布于 2025-03-19 22:41:16 浏览:155
订阅该版
```c #include
#define DBG_TAG "main" #define DBG_LVL DBG_LOG #include
static rt_bool_t flag; static int result; static rt_sem_t rt_sem; static int result1; static int result2; static struct rt_thread thread1; static struct rt_thread thread2; static char stack1[512]; static char stack2[512]; static void rt_thread1(void* parament) { LOG_E("thread1 success"); flag = 1; rt_sem_release(rt_sem); } static void rt_thread2(void* parament) { LOG_E("thread2 success"); result = rt_sem_take(rt_sem, RT_WAITING_FOREVER); if(flag && result == RT_EOK) { LOG_E("take success"); } rt_sem_delete(rt_sem); } int main(void) { rt_sem = rt_sem_create("sem", 0, RT_IPC_FLAG_PRIO); if(rt_sem == RT_NULL) { LOG_E("sem error"); return -1; } else { LOG_E("sem success"); } result1 = rt_thread_init(&thread1, "thread1", rt_thread1, RT_NULL, &stack1[0], sizeof(stack1), 24, 5); result2 = rt_thread_init(&thread2, "thread2", rt_thread2, RT_NULL, &stack2[0], sizeof(stack2), 25, 5); if(result1 == RT_EOK) { rt_thread_startup(&thread1); LOG_E("thread1 error"); return -1; } else { LOG_E("thread1 error"); return -1; } if(result2 == RT_EOK) { rt_thread_startup(&thread2); } else { LOG_E("thread2 error"); return -1; } ```
查看更多
1
个回答
默认排序
按发布时间排序
CrazyH
2025-03-20
这家伙很懒,什么也没写!
不知所谓啊
撰写答案
登录
注册新账号
关注者
0
被浏览
155
关于作者
zzzzzcx
这家伙很懒,什么也没写!
提问
5
回答
1
被采纳
0
关注TA
发私信
相关问题
1
rt_malloc 申请内存失败
2
webnet heap最大使用量。
3
调度锁会引起线程内存不足
4
RT-Thread内存和字符串相关函数与C语言自带的内存和字符串相关函数冲突问题
5
webnet 是否可以做全动态网页,使用内存池来加快速度
6
boatload跳转到app反复重启,难道你们编译器有问题?
7
怎么释放动态线程占用的内存
8
内存堆使用时产生不对齐
9
pandora开发板使用cjson,内存不足。
10
小内存管理中rt_realloc的实现问题
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
6
五分钟玩转RT-Thread新社区
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
STM32F429 搭配 CherryUSB 实现 AIR780E 上网(RNDIS + lwIP)
2
睿擎工业开发平台--I2C1驱动AMP2301读取温湿度
3
睿擎平台RK3506使用总结
4
使用deepseek协助开发,基于RK3506睿擎派开发板读取传感器数据
5
睿擎工业开发平台---文件系统测试使用
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
Bootloader
AT
Hardfault
CAN总线
ART-Pi
FinSH
DMA
USB
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
FAL
RTC
rt-smart
I2C_IIC
UART
cubemx
BSP
ESP8266
PWM
ota在线升级
WIZnet_W5500
packages_软件包
flash
freemodbus
GD32
潘多拉开发板_Pandora
ADC
编译报错
keil_MDK
定时器
flashDB
ulog
socket
rt_mq_消息队列_msg_queue
msh
中断
Debug
SFUD
C++_cpp
at_device
本月问答贡献
踩姑娘的小蘑菇
6
个答案
3
次被采纳
加缪
9
个答案
1
次被采纳
RTT_逍遥
5
个答案
1
次被采纳
用户名由3_15位
5
个答案
1
次被采纳
Ryan_CW
4
个答案
1
次被采纳
本月文章贡献
纯白酱
2
篇文章
3
次点赞
530china
1
篇文章
7
次点赞
rv666
1
篇文章
7
次点赞
踩姑娘的小蘑菇
1
篇文章
3
次点赞
Lipiah
1
篇文章
3
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部