We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
最新master分支上的idle.c文件中的rt_defunct_execute函数,该函数中有如下代码
while (rt_atomic_load(&(thread->ref_count))) { rt_thread_delay(5); }
1,此处循环原子读ref_count是想达到什么目的呢,在idle线程初始化里面ref_count初始化为0,所以不会进入该循环,这里正确用法是什么呢,若此值非0,是不是在其他线程里面会一直减这个ref_count呢? 2,非0情况下,idle线程就主动sleep,这里不是就挂起idle线程了吗,idle是允许被挂起的吧
The text was updated successfully, but these errors were encountered:
看起来是想实现一个让权等待,但是本来都在idle线程里了,让给谁呢?
Sorry, something went wrong.
哎,是有问题的,是bug
这是之前调试自旋锁的时候加的线程引用计数(防止释放线程的时候引用计数没释放干净),正常情况下线程ref进这里是0的。我下一个版本把线程引用计数删掉好了
xqyjlj
Successfully merging a pull request may close this issue.
最新master分支上的idle.c文件中的rt_defunct_execute函数,该函数中有如下代码
问题:
1,此处循环原子读ref_count是想达到什么目的呢,在idle线程初始化里面ref_count初始化为0,所以不会进入该循环,这里正确用法是什么呢,若此值非0,是不是在其他线程里面会一直减这个ref_count呢?
2,非0情况下,idle线程就主动sleep,这里不是就挂起idle线程了吗,idle是允许被挂起的吧
The text was updated successfully, but these errors were encountered: