Atomic.pointerCompareAndExchange

Compares oldval with the pointer pointed to by atomic and if they are equal, atomically exchanges *atomic with newval. Also acts as a memory barrier. Since 2.4

class Atomic
static
int
pointerCompareAndExchange
(
void** atomic
,
void* oldval
,
void* newval
)

Parameters

atomic void**

a pointer to a gpointer

oldval void*

the assumed old value of *atomic

newval void*

the new value of *atomic

Return Value

Type: int

TRUE, if *atomic was equal oldval. FALSE otherwise.

Meta