Skip to content

任务1 函数注释补充 #10423

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Codeman-1999
Copy link

@Codeman-1999 Codeman-1999 commented Jun 20, 2025

拉取/合并请求描述:(PR description)

[
新手任务1 函数注释补充,主要对libc/posix/pthread/pthread.c文件添加注释
]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

Copy link

github-actions bot commented Jun 20, 2025

📌 Code Review Assignment

🏷️ Tag: libc

Path: components/libc
Reviewers: mysterywolf GorrayLi

Changed Files (Click to expand)
  • components/libc/posix/pthreads/pthread.c

📊 Current Review Status (Last Updated: 2025-06-21 12:29 UTC)

  • GorrayLi Pending Review
  • mysterywolf 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.

@supperthomas supperthomas requested a review from Copilot June 20, 2025 17:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR supplements function comments in the POSIX pthread implementation.

  • Added detailed documentation for functions managing thread data structures, cleanup, and thread entry.
  • Updated comments include synchronization notes, error return details, and resource cleanup order.
Comments suppressed due to low confidence (1)

components/libc/posix/pthreads/pthread.c:144

  • The documentation for the function _destroy_item incorrectly describes its purpose as 'Create and initialize a new thread data structure'. Please update the comment to accurately reflect that it destroys and cleans up the thread data structure.
/**

@GorrayLi
Copy link
Contributor

GorrayLi commented Jun 21, 2025

关于commit提交描述,写成“任务1 函数注释补充”不好:
1.对修改内容描述不清晰,应指明修改或补充了什么模块的注释;
2.“任务1”看起来有点像“学生交作业”,最好去掉。
因此,对于commit描述信息,有如下建议:
1.可参考其他人的commit,建议写成:[模块名称]+对本次修改的描述,如[components/libc] add comments for some pthread functions.
2.commit信息用英文写。

@GorrayLi
Copy link
Contributor

关于commit提交描述,写成“任务1 函数注释补充”不好: 1.对修改内容描述不清晰,应指明修改或补充了什么模块的注释; 2.“任务1”看起来有点像“学生交作业”,最好去掉。 因此,对于commit描述信息,有如下建议: 1.可参考其他人的commit,建议写成:[模块名称]+对本次修改的描述,如[components/libc] add comments for some pthread functions. 2.commit信息用英文写。

另外,温馨提示一下:无需关闭PR再重新提交,只要在本地仓库用git rebase -i HEAD~2修改近两条commit信息(如果将两条提交合并成一条更好),然后git push --force即可。 如果本就知晓操作方式,请忽略这条消息。

任务1 函数注释补充.修改1

[components/libc] add comments for some pthread functions.
@Codeman-1999
Copy link
Author

关于commit提交描述,写成“任务1 函数注释补充”不好: 1.对修改内容描述不清晰,应指明修改或补充了什么模块的注释; 2.“任务1”看起来有点像“学生交作业”,最好去掉。 因此,对于commit描述信息,有如下建议: 1.可参考其他人的commit,建议写成:[模块名称]+对本次修改的描述,如[components/libc] add comments for some pthread functions. 2.commit信息用英文写。

另外,温馨提示一下:无需关闭PR再重新提交,只要在本地仓库用git rebase -i HEAD~2修改近两条commit信息(如果将两条提交合并成一条更好),然后git push --force即可。 如果本就知晓操作方式,请忽略这条消息。

@Codeman-1999 Codeman-1999 requested a review from GorrayLi June 21, 2025 11:39
* - Designed to be called during thread cleanup or explicit TLS destruction
* - Matches POSIX thread standard requirements for TLS destructor invocation
*/
static inline void git status(int index, _pthread_data_t *ptd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数名字被git status误覆盖了,请修复。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的好的

@GorrayLi
Copy link
Contributor

关于commit提交描述,写成“任务1 函数注释补充”不好: 1.对修改内容描述不清晰,应指明修改或补充了什么模块的注释; 2.“任务1”看起来有点像“学生交作业”,最好去掉。 因此,对于commit描述信息,有如下建议: 1.可参考其他人的commit,建议写成:[模块名称]+对本次修改的描述,如[components/libc] add comments for some pthread functions. 2.commit信息用英文写。

另外,温馨提示一下:无需关闭PR再重新提交,只要在本地仓库用git rebase -i HEAD~2修改近两条commit信息(如果将两条提交合并成一条更好),然后git push --force即可。 如果本就知晓操作方式,请忽略这条消息。

现在两个commit记录看上去有点奇怪,第一个还是中文,第二个commit diff只有两个空行。

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

Successfully merging this pull request may close these issues.

2 participants