Function

GLibOnceinit_leave_pointer

since: 2.80

Declaration

void
g_once_init_leave_pointer (
  void* location,
  gpointer result
)

Description

Counterpart to g_once_init_enter_pointer(). Expects a location of a static NULL-initialized initialization variable, and an initialization value other than NULL. Sets the variable to the initialization value, and releases concurrent threads blocking in g_once_init_enter_pointer() on this initialization variable.

This functions behaves in the same way as g_once_init_leave(), but can be used to initialize pointers (or #guintptr) instead of #gsize.

Available since: 2.80

Parameters

location

Type: void*

Location of a static initializable variable containing NULL

The data is owned by the caller of the function.
result

Type: gpointer

New non-NULL value for *location

The argument can be NULL.
The data is owned by the caller of the function.