use compare_exchange for notified variable