silc_atomic_cas_pointer

SYNOPSIS

    static inline
    SilcBool silc_atomic_cas_pointer(SilcAtomicPointer *atomic,
                                     void *old_ptr, void *new_ptr);

DESCRIPTION

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