implement atomic store