/* If the original value at <target> does not equal <oldValue>, then the target will not be updated and return 0. */
int rhino_atomic_cas(atomic_t *target, atomic_val_t old_value, atomic_val_t new_value)
/* If the original value at <target> does not equal <oldValue>, then the target will not be updated and return 0. */
int rhino_atomic_cas(atomic_t *target, atomic_val_t old_value, atomic_val_t new_value)
{
    CPSR_ALLOC();
    int ret = 0;
    RHINO_CPU_INTRPT_DISABLE();
    if (*target == old_value){
        *target = new_value;
        ret = 1;
    }
    RHINO_CPU_INTRPT_ENABLE();
    return ret;
}