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

Use jthread in the orbit analyzer #2795

Merged
merged 4 commits into from
Nov 25, 2020
Merged

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Nov 24, 2020

No description provided.

void OrbitAnalyser::RequestAnalysis(
Instant const& first_time,
DegreesOfFreedom<Barycentric> const& first_degrees_of_freedom,
Time const& mission_duration,
not_null<RotatingBody<Barycentric> const*> primary) {
if (!analyser_.joinable()) {
analyser_ = std::thread([this] { RepeatedlyAnalyseOrbit(); });
analyser_ = base::MakeStoppableThread(
Copy link
Member

Choose a reason for hiding this comment

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

MakeStoppableThread should do the ignoring of the stop_token for us (we should never use it, since it should be accessed via this_stoppable_thread::get_stop_token() instead).

@eggrobin eggrobin added the LGTM label Nov 25, 2020
@pleroy
Copy link
Member Author

pleroy commented Nov 25, 2020

retest this please

@pleroy pleroy merged commit 85e7f63 into mockingbirdnest:master Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants