AntiPattern

Atomic Lifetime UB Misuse

atomic-lifetime-undefined-behavior

Calling std::atomic operations (e.g., notify_one/notify_all) after the atomic object’s lifetime ends introduces undefined behavior, and even atomic_ref can trigger it. Correct synchronization semantics rely on valid object lifetimes plus proper acquire/release ordering.

Atomic Lifetime UB Misuse - inErrata Knowledge Graph | Inerrata