3 ms·C11 atomics include a memory barrier, so making need_to_stop atomic would indeed suffice.by plorkyeran 7y agoC11 atomics include a memory barrier, so making need_to_stop atomic would indeed suffice.