Skip to content

Commit 365a91d

Browse files
Balázs BarkóBalázs Barkó
authored andcommitted
atomic_gssize: create compare and exchange function
Signed-off-by: Balázs Barkó <Balazs.Barko@oneidentity.com>
1 parent 14610e3 commit 365a91d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/atomic-gssize.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ atomic_gssize_and(atomic_gssize *a, gsize value)
112112
return g_atomic_pointer_and(&a->value, value);
113113
}
114114

115+
static inline gboolean
116+
atomic_gssize_compare_and_exchange(atomic_gssize *a, gssize oldval, gssize newval)
117+
{
118+
return g_atomic_pointer_compare_and_exchange(&a->value, oldval, newval);
119+
}
120+
115121
static inline gssize
116122
atomic_gssize_set_and_get(atomic_gssize *a, gssize value)
117123
{

0 commit comments

Comments
 (0)