RT-Thread / RT-Thread/rt-thread
[Bug] 在开中断的情况下waitqueue可能醒不来
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
RT-Thread Version
master
Hardware Type/Architectures
loongarch
Develop Toolchain
GCC
Describe the bug
rt_wqueue_wait_interrupt可能会一直睡眠。
原因是condition是一个整数而不是指针或其他,调用前和运行中condition可能会变化,但是由于不是指针,内部无法察觉。
更改建议:
方案1(优选): 如linux的wait queue代码,将函数定义改为宏定义
方案2: 增加指针传入的方法
Other additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the rt_wqueue_wait_interrupt entry point and trace its waitqueue condition handling on the loongarch target using GCC. Compare the proposed macro-based and pointer-based approaches, then verify that a condition change while interrupts are enabled cannot leave the caller sleeping indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100