Skip to content
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

Wait for Wiring Thread to start #1528

Merged
merged 4 commits into from Dec 14, 2018

Conversation

Projects
None yet
3 participants
@monkbroc
Copy link
Member

commented Apr 17, 2018

Wait for Wiring Thread to reach Thread::run before returning from the constructor to avoid HardFault crash when the Thread instance is not available anymore.

Fixes #1527. See that issue for details, steps to reproduce and example app.

This is a regression that was introduced in 0.7.0. It should be backported to the 0.7.x line.

References

  • [CH17452]

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)
Wait for Wiring Thread to start
Wait for Wiring Thread to reach Thread::run before returning from the constructor to avoid HardFault crash when the Thread instance is not available anymore. Fixes #1527

@monkbroc monkbroc force-pushed the feature/thread-wait-start branch from 6198757 to ce38773 Apr 19, 2018

@m-mcgowan m-mcgowan added this to the 0.7.1 milestone May 7, 2018

@@ -67,6 +67,7 @@ class Thread
mutable wiring_thread_fn_t *wrapper = NULL;
os_thread_fn_t func_ = NULL;
void* func_param_ = NULL;
bool started_ = false;

This comment has been minimized.

Copy link
@m-mcgowan

m-mcgowan May 7, 2018

Contributor

doesn't this need to be volatile since it's accessed by multiple threads without any memory guard?

@sergeuz

This comment has been minimized.

Copy link
Member

commented Dec 14, 2018

I've refactored this PR a little, since in the original code there still was a possibility for func_, wrapper and other members of the Thread class to be accessed via an invalid pointer in the run() method

@sergeuz sergeuz merged commit dd9d551 into develop Dec 14, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@sergeuz sergeuz deleted the feature/thread-wait-start branch Dec 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.