-
Notifications
You must be signed in to change notification settings - Fork 3k
Timer: minor revisions #12905
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
Timer: minor revisions #12905
Conversation
The copy/move API extension stuff is a bit pointless, but it occurred to me while cleaning this up and after a comment about One use I can immediately imagine is sticking a |
@kjbracey-arm, thank you for your changes. |
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.
I don't know if it will be useful but the code change looks good.
PR description should be updated though as I can't see some of the minor revisions described.
Oh, guess it was parked a while, and there was a bit of rebasing. Some of those changes already happened in the Chrono work when |
@kjbracey-arm Looking at the commit, it still has the old description - should be updated as well as Timer ? Please do and we can start CI later today. |
Updated commit message. CI started. |
Test run: FAILEDSummary: 1 of 6 test jobs failed Failed test jobs:
|
* C++11-ify a little. * Make it copy/move constructible.
Reworked to pass tests, which apparently I'd failed to run on the final version. Realised while doing it that we were missing the necessary locking on the copy constructor. Which turned out to be an interesting C++ exercise - answer found at https://www.justsoftwaresolutions.co.uk/threading/thread-safe-copy-constructors.html In GCC at least those seem to compile to optimal code, fully inlining the locking and state copying into the copy constructor, with no visible overhead from the dummy parameters. |
I'll run CI meanwhile |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
Already approved, will merge now |
Summary of changes
Constify relevant methods.(already done in C++ Chrono support #12425)Remove unneeded lock from destructor.(already done in C++ Chrono support #12425)Impact of changes
Timer
andLowPowerTimer
are a little more flexible, and slightly optimised.Migration actions required
n/a
Documentation
None
Pull request type
Test results
Reviewers