.\" Automatically generated man page, do not edit .TH QB_ATOMIC_POINTER_COMPARE_AND_EXCHANGE 3 2023-07-21 "LIBQB" "libqb Programmer's Manual" .SH NAME qb_atomic_pointer_compare_and_exchange \- Compares oldval with the pointer pointed to by atomic and if they are equal, atomically exchanges *atomic with newval. .SH SYNOPSIS .nf .B #include .sp \fBint32_t qb_atomic_pointer_compare_and_exchange\fP( \fBvolatile void *QB_GNUC_MAY_ALIAS *\fP\fIatomic\fP,\fR /* a pointer to a void* */ \fBvoid *\fP\fIoldval\fP,\fR /* the assumed old value of *atomic */ \fBvoid *\fP\fInewval\fP\fR /* the new value of *atomic*/ ); .fi .SH PARAMS \fBatomic \fP\fIa pointer to a void* \fP .PP \fBoldval \fP\fIthe assumed old value of *atomic \fP .PP \fBnewval \fP\fIthe new value of *atomic\fP .PP .SH DESCRIPTION .PP Also acts as a memory barrier. .RE .SH RETURN VALUE .PP QB_TRUE if atomic was equal oldval, else QB_FALSE. .PP .SH SEE ALSO .PP .nh .ad l \fIqb_atomic_int_set\fR(3), \fIqb_atomic_int_compare_and_exchange\fR(3), \fIqb_atomic_int_get\fR(3), \fIqb_atomic_int_add\fR(3), \fIqb_atomic_init\fR(3), \fIqb_atomic_pointer_get\fR(3), \fIqb_atomic_int_exchange_and_add\fR(3), \fIqb_atomic_pointer_set\fR(3) .ad .hy .SH "COPYRIGHT" .PP Copyright (C) 2003 Sebastian Wilhelmi