logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ck_pr_cas_ptr, ck_pr_cas_ptr_value, ck_pr_cas_ptr_2, ck_pr_cas_ptr_2_value, ck_pr_cas_double,

Description

       The  ck_pr_cas(3)  family of functions atomically compare the value in target for equality with old_value
       and if so, replace the value pointed to by target with the value specified by new_value.  If the value in
       target was not equal to the value specified by old_value then no modifications  occur  to  the  value  in
       target.  The *_value form of these functions unconditionally update original_value.

Library

       Concurrency Kit (libck, -lck)

Name

       ck_pr_cas_ptr,    ck_pr_cas_ptr_value,    ck_pr_cas_ptr_2,    ck_pr_cas_ptr_2_value,    ck_pr_cas_double,
       ck_pr_cas_double_value,  ck_pr_cas_char,  ck_pr_cas_char_value,   ck_pr_cas_uint,   ck_pr_cas_uint_value,
       ck_pr_cas_int,      ck_pr_cas_int_value,      ck_pr_cas_64_2,     ck_pr_cas_64_2_value,     ck_pr_cas_64,
       ck_pr_cas_64_value,  ck_pr_cas_32,  ck_pr_cas_32_value,  ck_pr_cas_16,  ck_pr_cas_16_value,  ck_pr_cas_8,
       ck_pr_cas_8_value — atomic compare-and-swap operations

Return Values

       This  family  of  functions return true if the value in target was modified as a result of the operation.
       Otherwise, they return false.

See Also

ck_pr_fence_load(3),    ck_pr_fence_load_depends(3),     ck_pr_fence_store(3),     ck_pr_fence_memory(3),
       ck_pr_load(3),  ck_pr_store(3),  ck_pr_fas(3),  ck_pr_faa(3),  ck_pr_inc(3),  ck_pr_dec(3), ck_pr_neg(3),
       ck_pr_not(3),  ck_pr_sub(3),  ck_pr_and(3),  ck_pr_or(3),   ck_pr_xor(3),   ck_pr_add(3),   ck_pr_btc(3),
       ck_pr_bts(3), ck_pr_btr(3)

       Additional information available at http://concurrencykit.org/

                                                 April 11, 2013                                     ck_pr_cas(3)

Synopsis

#include<ck_pr.h>boolck_pr_cas_ptr(void*target, void*old_value, void*new_value);

       boolck_pr_cas_ptr_value(void*target, void*old_value, void*new_value, void*original_value);

       boolck_pr_cas_ptr_2(void*target, void*old_value, void*new_value);

       boolck_pr_cas_ptr_2_value(void*target, void*old_value, void*new_value, void*original_value);

       boolck_pr_cas_double(double*target, doubleold_value, doublenew_value);

       boolck_pr_cas_double_value(double*target, doubleold_value, doublenew_value, double*original_value);

       boolck_pr_cas_char(char*target, charold_value, charnew_value);

       boolck_pr_cas_char_value(char*target, charold_value, charnew_value, char*original_value);

       boolck_pr_cas_uint(unsignedint*target, unsignedintold_value, unsignedintnew_value);

       boolck_pr_cas_uint_value(unsignedint*target,   unsignedintold_value,   unsignedintnew_value,
           unsignedint*original_value);

       boolck_pr_cas_int(int*target, intold_value, intnew_value);

       boolck_pr_cas_int_value(int*target, intold_value, intnew_value, int*original_value);

       boolck_pr_cas_64_2(uint64_ttarget[static2], uint64_told_value[static2], uint64_tnew_value[static2]);

       boolck_pr_cas_64_2_value(uint64_ttarget[static2],       uint64_told_value[static2],
           uint64_tnew_value[static2], uint64_toriginal_value[static2]);

       boolck_pr_cas_64(uint64_t*target, uint64_told_value, uint64_tnew_value);

       boolck_pr_cas_64_value(uint64_t*target, uint64_told_value, uint64_tnew_value, uint64_t*original_value);

       boolck_pr_cas_32(uint32_t*target, uint32_told_value, uint32_tnew_value);

       boolck_pr_cas_32_value(uint32_t*target, uint32_told_value, uint32_tnew_value, uint32_t*original_value);

       boolck_pr_cas_16(uint16_t*target, uint16_told_value, uint16_tnew_value);

       boolck_pr_cas_16_value(uint16_t*target, uint16_told_value, uint16_tnew_value, uint16_t*original_value);

       boolck_pr_cas_8(uint8_t*target, uint8_told_value, uint8_tnew_value);

       boolck_pr_cas_8_value(uint8_t*target, uint8_told_value, uint8_tnew_value, uint8_t*original_value);

See Also