update atomic a_cas implemenation adopted from linux kernel