-
Notifications
You must be signed in to change notification settings - Fork 3k
Kernel.h doxygen update #8435
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
Kernel.h doxygen update #8435
Conversation
rtos/Kernel.h
Outdated
*/ | ||
void attach_idle_hook(void (*fptr)(void)); | ||
|
||
/** Attach a function to be called when a task is killed | ||
/** Attach a function to be called when a task is terminated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"killed" sounds like a forceful action, but in reality the callback gets called when a thread terminates. So changing the wording to "terminated"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, but I think the wording should actually be what you said in the comment: "when a thread terminates".
rtos/Kernel.h
Outdated
@param fptr pointer to the function to be called | ||
|
||
@note You may call this function from ISR context. | ||
@note You can call this function from ISR context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kjbracey-arm - I think we need to be stricter, so Im changing to "can", please review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "may" wording is used in lots of other files, so if you want to change it should be consistent. Although it's "cannot" in the same places. I'd say the docs team probably have a global style rule here, so check with them.
I think "may" is clearer for the positive case, personally - it says you're "permitted" to, rather than just being "able" to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is for a new user wanting to use this function doesn't get much info from reading this. When we say "may" it sounds like user should go find if its even possible for the specific context he wants to use. I also wonder why someone would want to use these functions from ISR context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kjbracey-arm ^^^
(It wasn't to clear to me that he had already replied)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kjbracey-arm - Can you please look at my comment above? You did raise a good point about consistency but I do think that can be addressed in other parts while we can document this better still.
rtos/Kernel.h
Outdated
*/ | ||
void attach_idle_hook(void (*fptr)(void)); | ||
|
||
/** Attach a function to be called when a task is killed | ||
/** Attach a function to be called when a task is terminated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, but I think the wording should actually be what you said in the comment: "when a thread terminates".
rtos/Kernel.h
Outdated
@param fptr pointer to the function to be called | ||
|
||
@note You may call this function from ISR context. | ||
@note You can call this function from ISR context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "may" wording is used in lots of other files, so if you want to change it should be consistent. Although it's "cannot" in the same places. I'd say the docs team probably have a global style rule here, so check with them.
I think "may" is clearer for the positive case, personally - it says you're "permitted" to, rather than just being "able" to.
@SenRamakri Please review @kjbracey-arm's comments |
@cmonr - I have already responded to @kjbracey-arm comments. I'm waiting for his thoughts on that. |
@kjbracey-arm Mind responing to @SenRamakri? Thoughts on how to move this forward? |
I'm unsure what the current "state-of-the-art" of "interrupt safety" documentation is. Is there a current equivalent of this page? https://docs.mbed.com/docs/mbed-os-handbook/en/5.2/concepts/thread_safety/ ? I see some files still use those terms. So I'm not even sure if we should be tinkering with this wording (which a lot of files use) or using something totally different. If we are tinkering this this wording, "may" seems more formally correct to me than "can", so I'm not particularly keen on the change. Obviously you /can/ - no-one can stop you - but are you permitted to? I think this is one for @AnotherButler, really, but... https://dictionary.cambridge.org/grammar/british-grammar/can-could-or-may And yes, no idea why anyone would want to call those from ISR - I expect the docs are the result of someone inspecting what looked like it would work and annotating. |
The equivalent of that page is https://os.mbed.com/docs/latest/porting/thread-safety-and-porting.html |
8d9ef11
to
4cdcdc1
Compare
@kjbracey-arm @AnotherButler - I have pushed new changes with review comments addressed. I also have reverted from "can" to "may" as I think it doesn't matter much as mentioned in the descriptions in the links provided by @kjbracey-arm, so please review again. |
Make minor copy edits for active voice, branding and deletion of extra spaces.
Note: This PR is now a part of a rollup PR (#8663). No further work is needed here, as once that PR is merged, this PR will also be closed and marked as merged. If any more commits are made in this PR, this PR will remain open and have to go through CI on its own. |
Description
Minor fix for Kernel.h doxygen comments
Pull request type