pointerBitLockAndGet

This is equivalent to g_bit_lock, but working on pointers (or other pointer-sized values).

For portability reasons, you may only lock on the bottom 32 bits of the pointer.

void
pointerBitLockAndGet
(
void* address
,
uint lockBit
,
out size_t outPtr
)

Parameters

address void*

a pointer to a #gpointer-sized value

lockBit uint

a bit value between 0 and 31

outPtr size_t

returns the set pointer atomically. This is the value after setting the lock, it thus always has the lock bit set, while previously address had the lockbit unset. You may also use glib.global.pointerBitLockMaskPtr to clear the lock bit.