All challenges
Multiple ChoiceBeginner 45s

jthread RAII and Auto-join

What does std::jthread guarantee at destruction that std::thread does not?
Options
  1. 1It detaches the thread automatically so the caller never blocks at destruction
  2. 2It calls std::terminate if the thread is still joinable when the object dies
  3. 3It requests stop via its stop_source then joins the thread, unless already joined
  4. 4It runs the thread function directly on the calling thread if not already started

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle