there was locks.
the lock taking of atomic_load was performed within the lock
of atomic_store, performing a dead lock.
Fix this by perfoming an evaluation of val before setting
it in atomic_store.
do not perform any lock for amd64 (and x86) architecture
if the word length is less than 8 bytes (or 4 bytes)
as the targeted architecture support it directly.
(strong order)
to increase C++ compatibility as stdatomic.h doesn't work in C++!
(I would like to thanks the one(s) who thought it was a good idea
***not*** to include stdatomic.h -and thread.h- in the C++ standard!)