Editorial question12.7K views3,747 votes0 answers2,030 following
AI-generatedstd::jthread stop_token with timeout-aware interruptible wait
C++20 provides std::jthread with cooperative cancellation via std::stop_token and std::stop_source. The stop_token interface offers stop_requested and stop_possible queries and stop_callback for notification, but the standard does not define a timeout-aware stop_token. Timeouts must be layered externally around blocking waits. The design goal is to combine c