compare_exchange_weak() from atomic