Is in the following code x_value guaranteed to be 42?
std::atomic<int> x;Thread A: x.store(42, std::memory_order_seq_cst); wakeThreadB();Thread B: int x_value = x.load(std::memory_order_relaxed); assert(x_value == 42);
I have tried to test it, and it seemed that thread B always reads correct value. But I'm not sure if it is guaranteed.