Skip to content

cf_atomic_ptr_cas

Category: atomic
GitHub: cute_multithreading.h


Atomically sets atomic to value if expected equals atomic.

CF_Result cf_atomic_ptr_cas(void** atomic, void* expected, void* value);
Parameters Description
atomic The pointer to atomically manipulate.
expected Used to compare against atomic.
value A value to atomically set to atomic.

Return Value

Returns success if the value was set, error otherwise.

Remarks

Atomics are an advanced topic. You've been warned! Beej has a good article on atomics.

cf_atomic_zero
cf_atomic_add
cf_atomic_set
cf_atomic_get
cf_atomic_cas
cf_atomic_ptr_set
cf_atomic_ptr_get