An atomic makes one operation indivisible, with no lock: fetch_add, exchange, compare_exchange_weak, load, store. A sequence is not: x.store(x.load() + 1) is two steps, and another thread can run between them. Use an atomic for one independent value (a counter, a flag, an id source) and a mutex when values must change together.
Memory order: memory_order_relaxed suits a pure counter; to publish data, store the flag with memory_order_release and load it with memory_order_acquire; the default, seq_cst, is always safe. A plain bool used as a flag between threads is a data race.
The simulator runs every atomic in order (sequentially consistent), so a memory order that is too weak cannot fail a test here, though it can on a real CPU; where this lesson asks for an order, a rule on your code checks it.
Threads here are simulated. Your program runs on one real thread while a scheduler switches between your threads at shared reads and writes, locks, atomic operations, waits, yields and sleeps, and every test runs under 12 different schedules. The order things can happen in, races at those points and deadlocks are faithful. Real parallel speed-up and weak memory-order effects are not.
Release publishes everything written before it; acquire receives it.