Skip to content

Conversation

Rbb666
Copy link
Member

@Rbb666 Rbb666 commented Sep 1, 2025

修改rt_thread_suspend 以支持可以挂起其他线程

新增三个测试用例:

  1. test_suspend_force_api_basic: 基础API测试。
  2. test_suspend_force_normal_usage:创建工作线程和监控线程,验证 rt_thread_suspend_force 函数能够正确挂起和恢复目标线程,确保线程状态转换正常且系统调度稳定。
  3. test_suspend_force_deadlock_risk:用于验证和演示强制挂起可能带来的死锁问题。
image

@github-actions github-actions bot added the Kernel PR has src relate code label Sep 1, 2025
Copy link

github-actions bot commented Sep 1, 2025

📌 Code Review Assignment

🏷️ Tag: kernel

Reviewers: GorrayLi ReviewSun hamburger-os lianux-mm wdfk-prog xu18838022837

Changed Files (Click to expand)
  • src/thread.c

📊 Current Review Status (Last Updated: 2025-09-08 14:48 CST)

  • GorrayLi Pending Review
  • ReviewSun Pending Review
  • hamburger-os Pending Review
  • lianux-mm Pending Review
  • wdfk-prog Pending Review
  • xu18838022837 Pending Review

📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@Rbb666 Rbb666 requested a review from Guozhanxin September 1, 2025 14:49
@Rbb666 Rbb666 marked this pull request as draft September 2, 2025 08:58
@Rbb666 Rbb666 marked this pull request as ready for review September 2, 2025 09:57
@BernardXiong
Copy link
Member

这个命名有些显得随意了

@Rbb666
Copy link
Member Author

Rbb666 commented Sep 3, 2025

这个命名有些显得随意了

@BernardXiong rt_thread_suspend_force 怎么样?或者有其他好的建议吗?

@Rbb666 Rbb666 changed the title [add][thread]Add api:rt_thread_suspend_any allow suspend other threads. [add][thread]Add api:rt_thread_suspend_force allow suspend other threads. Sep 5, 2025
@Rbb666
Copy link
Member Author

Rbb666 commented Sep 5, 2025

这个命名有些显得随意了

@BernardXiong 熊大,命名已修改为 rt_thread_suspend_force,请 review

@Rbb666 Rbb666 requested a review from BernardXiong September 6, 2025 08:45
@Guozhanxin
Copy link
Member

如果大家确实有挂起其他线程的需求,是不是还是直接把我们原来suspend api里面人为添加的限制取消掉就好了。现在这么做又加了好几个函数,感觉意义不大。

@Rbb666
Copy link
Member Author

Rbb666 commented Sep 8, 2025

如果大家确实有挂起其他线程的需求,是不是还是直接把我们原来suspend api里面人为添加的限制取消掉就好了。现在这么做又加了好几个函数,感觉意义不大。

那我直接针对 rt_thread_suspend 进行修改吧

@Rbb666
Copy link
Member Author

Rbb666 commented Sep 8, 2025

@Guozhanxin 已修改,并完善使用注意事项,请再次review

@Rbb666 Rbb666 changed the title [add][thread]Add api:rt_thread_suspend_force allow suspend other threads. [add][thread]Modify rt_thread_suspend to support suspending other threads. Sep 8, 2025
@Rbb666 Rbb666 changed the title [add][thread]Modify rt_thread_suspend to support suspending other threads. [thread]Modify rt_thread_suspend to support suspending other threads. Sep 8, 2025
@Rbb666 Rbb666 merged commit e1c1a07 into RT-Thread:master Sep 9, 2025
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BSP Kernel PR has src relate code testcase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants