Skip to content

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

Merged
merged 3 commits into from
Nov 7, 2018
Merged

Conversation

SenRamakri
Copy link
Contributor

Description

Minor fix for Kernel.h doxygen comments

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[x] Docs update
[ ] Test update
[ ] Breaking change

@SenRamakri SenRamakri requested a review from kjbracey October 15, 2018 19:01
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
Copy link
Contributor Author

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"

Copy link
Contributor

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.
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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)

Copy link
Contributor Author

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
Copy link
Contributor

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.
Copy link
Contributor

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.

@cmonr
Copy link
Contributor

cmonr commented Oct 18, 2018

@SenRamakri Please review @kjbracey-arm's comments

@SenRamakri
Copy link
Contributor Author

SenRamakri commented Oct 19, 2018

@cmonr - I have already responded to @kjbracey-arm comments. I'm waiting for his thoughts on that.

@cmonr
Copy link
Contributor

cmonr commented Oct 29, 2018

@kjbracey-arm Mind responing to @SenRamakri? Thoughts on how to move this forward?

@kjbracey
Copy link
Contributor

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
https://en.oxforddictionaries.com/usage/can-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.

@AnotherButler
Copy link
Contributor

The equivalent of that page is https://os.mbed.com/docs/latest/porting/thread-safety-and-porting.html

@SenRamakri SenRamakri force-pushed the sen_KernelDoxyUpdate branch from 8d9ef11 to 4cdcdc1 Compare October 29, 2018 18:54
@SenRamakri
Copy link
Contributor Author

@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.
@cmonr
Copy link
Contributor

cmonr commented Nov 7, 2018

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.

@0xc0170 0xc0170 merged commit 2418d9c into ARMmbed:master Nov 7, 2018
@0xc0170 0xc0170 removed the needs: CI label Nov 7, 2018
@cmonr cmonr removed the rollup PR label Nov 7, 2018
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.

5 participants