g_atomic_pointer_compare_and_exchange seems to have the wrong signature
* Compares @atomic to @oldval and, if equal, sets it to @newval.
* If @atomic was not equal to @oldval then no change occurs.
*
* This compare and exchange is done atomically.
*
* Think of this operation as an atomic version of
* `{ if (*atomic == oldval) { *atomic = newval; return TRUE; } else return FALSE; }`.
*
gboolean
(g_atomic_pointer_compare_and_exchange) (volatile void *atomic,
gpointer oldval,
gpointer newval)
Shouldn't atomic
be void**
a.k.a gpointer*
? Otherwise the caller needs to intuit that passing an actual void*
will not have the desired results and might crash if *atomic
is unassignable.