Skip to content

Fix ticker_read_us() race condition. #9186

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 1 commit into from
Jan 2, 2019
Merged

Fix ticker_read_us() race condition. #9186

merged 1 commit into from
Jan 2, 2019

Conversation

tkem
Copy link
Contributor

@tkem tkem commented Dec 21, 2018

Description

ticker_event_queue_t::present_time is an us_timestamp_t, which is 64-bit, and therefore not atomic. It is therefore subject to race conditions if accessed outside a critical section, especially since it is also updated in ticker_irq_handler.

Pull request type

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

Reviewers

@ciarmcom ciarmcom requested review from a team December 21, 2018 20:00
@ciarmcom
Copy link
Member

@tkem, thank you for your changes.
@ARMmbed/mbed-os-hal @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@mprse mprse left a comment

Choose a reason for hiding this comment

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

Nice catch!

@NirSonnenschein
Copy link
Contributor

CI started

1 similar comment
@cmonr
Copy link
Contributor

cmonr commented Dec 28, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 28, 2018

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@NirSonnenschein
Copy link
Contributor

seems to be a timeout in one test . retrying.

@mbed-ci
Copy link

mbed-ci commented Dec 31, 2018

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

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.

8 participants