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

Add support for finding the stop_token for the current thread #2792

Merged
merged 3 commits into from
Nov 24, 2020

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Nov 22, 2020

No description provided.

base/jthread.hpp Outdated
@@ -101,12 +103,24 @@ class jthread {
std::thread thread_;
};

class this_jthread {
Copy link
Member

Choose a reason for hiding this comment

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

Not all jthreads can access themselves via this_jthread, so the name is misleading ; we need a dedicated one.

this_cancellable_thread, MakeCancellableThread at namespace scope, because this_cancellable_thread::Make is awkward and similarly misleading (you are not making this thread, you are making a new one).
Cancellable after the CANCELLED status, which we will use for cancellation propagation.

No need to reify a cancellable_thread type, but using unique wording makes it clear that this only applies to threads created by the appropriate factory.

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

pleroy commented Nov 24, 2020

retest this please

@pleroy pleroy merged commit 7d6bff8 into mockingbirdnest:master Nov 24, 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