pointerBitUnlockAndSet

This is equivalent to glib.global.pointerBitUnlock and atomically setting the pointer value.

Note that the lock bit will be cleared from the pointer. If the unlocked pointer that was set is not identical to ptr, an assertion fails. In other words, ptr must have lock_bit unset. This also means, you usually can only use this on the lowest bits.

void
pointerBitUnlockAndSet
(
void* address
,
uint lockBit
,
void* ptr
,)

Parameters

address void*

a pointer to a #gpointer-sized value

lockBit uint

a bit value between 0 and 31

ptr void*

the new pointer value to set

preserveMask size_t

if non-zero, those bits of the current pointer in address are preserved. Note that the lock_bit bit will be always set according to set, regardless of preserve_mask and the currently set value in address.