Mixed practice for the unit, on new problems. For each one, decide first what is shared and what protects it: an atomic for one independent value, a mutex for anything that must change together, a condition variable to wait for a change, a future for a result. Then check the edge cases: empty inputs, the same object passed twice, a stop that arrives mid-wait.
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.