在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1461|回复: 3

[求助] event复制,怎么不work?

[复制链接]
发表于 2021-8-11 21:14:02 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
image.png

为啥 thread2没有打印呢 ? expect的结果应该是[20] Thread2:wait for ev_b is over
 楼主| 发表于 2021-8-11 21:17:57 | 显示全部楼层
image.png
发表于 2021-8-11 23:17:54 | 显示全部楼层
标准里面这段后面还有一段:
When events are merged, the assignment only affects the execution of subsequent event control or wait
operations. If a process is blocked waiting for event1 when another event is assigned to event1, the
currently waiting process shall never unblock.
所以如果由正在等待event1的线程,而 event1被赋予event2,此时等待event1的线程将不会unblock;
所以如果想要ev_b等待线程能执行, ev_b = ev_a的执行必须要在wait(ev_b.triggered)之前;
 楼主| 发表于 2021-8-12 09:48:36 | 显示全部楼层


miccjiang 发表于 2021-8-11 23:17
标准里面这段后面还有一段:
When events are merged, the assignment only affects the execution of subs ...


ev_b=ev_a;这句话一定要发生在wait ev_b之前,否则wait ev_b的进程永远不会unblock。 我改了下,现在ev_b等到了
image.png


您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-28 23:56 , Processed in 0.020196 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表