Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

canfstvl_timer_sem有概率出现问题,接收线程和时间线程会锁死 #23

Open
andypengzai opened this issue Nov 29, 2023 · 1 comment

Comments

@andypengzai
Copy link

作者您好,现在遇到个问题canfestival 做从机 当主机不停的重启 会造成从机canfstvl_timer_sem这个信号上的cf time线程被移除。然后canfestival接收线程和时间线程全部卡在互斥量上

@gbcwbz
Copy link
Owner

gbcwbz commented Dec 4, 2023

while(1)
{
if(rt_sem_take(canfstvl_timer_sem, RT_WAITING_FOREVER) != RT_EOK) {
LOG_E("canfestival take timer sem failed");
return;
}
EnterMutex();
rt_size_t read_size = rt_device_read(canfstvl_timer_dev, 0, &last_timer_val, sizeof(last_timer_val));
if( read_size == 0) {
LOG_E("canfestival read timer failed, err = %d", rt_get_errno());
} else {
TimeDispatch();
}
LeaveMutex();
}

  • 如果是 cf_timer 线程退出了,你可以看一下有没有报错,报错原因是什么
  • 我没用这个做过从站,可能哪里处理的有问题,你可以查一下,欢迎PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants