silc_atomic_cas16

SYNOPSIS

    static inline
    SilcBool silc_atomic_cas16(SilcAtomic16 *atomic, SilcUInt16 old_val,
                               SilcUInt16 new_val)

DESCRIPTION

Performs compare and swap (CAS). Atomically compares if the variable `atomic' has the value `old_val' and in that case swaps it with the value `new_val'. Returns TRUE if the old value was same and it was swapped and FALSE if it differed and was not swapped.