.\" Automatically generated man page, do not edit .TH QB_ATOMIC_INT_COMPARE_AND_EXCHANGE 3 2020-10-31 "LIBQB" "libqb Programmer's Manual" .SH NAME qb_atomic_int_compare_and_exchange \- Compares oldval with the integer pointed to by atomic and if they are equal, atomically exchanges *atomic with newval. .SH SYNOPSIS .nf .B #include .sp \fBint32_t qb_atomic_int_compare_and_exchange\fP( \fBvolatile int32_t QB_GNUC_MAY_ALIAS *\fP\fIatomic\fP, \fBint32_t \fP\fIoldval\fP, \fBint32_t \fP\fInewval\fP ); .fi .SH PARAMS \fBatomic \fP\fIa pointer to an integer \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. QB_FALSE otherwise. .PP .SH SEE ALSO .PP .nh .ad l \fIqb_atomic_int_set\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_compare_and_exchange\fR(3), \fIqb_atomic_pointer_set\fR(3) .ad .hy .SH "COPYRIGHT" .PP Copyright (C) 2010-2020 Red Hat, Inc. All rights reserved.