jthread icon indicating copy to clipboard operation
jthread copied to clipboard

C++ class for a joining and cooperative interruptible thread (should become std::jthread)

Results 4 jthread issues
Sort by recently updated
recently updated
newest added

Is there any particular reason why jthread does not allow constructing with external stop_source? Was this ever considered in the standards? Can't see any problems with such constructor, so just...

``` int main() { auto token = std::stop_token{}; auto thrd = std::jthread{[](std::stop_token){}, token}; assert(thrd.get_stop_token() == token); // surprise return EXIT_SUCCESS; } ``` Just small question regarding the intended way the...

Repro steps: - create a stop_source - get two stop tokens - destroy the source - destroy one of the stop_token (the internal state is deleted) - destroy the second...

https://github.com/josuttis/jthread/blob/0fa8d394254886c555d6faccd0a3de819b7d47f8/source/stop_token.hpp#L56