fixed: use a 32 bit unsigned int for compare and exchange