TypeScript API Documentation for GLIB
API Version: 2.0
Library Version: 2.86.4
Generated with TypeDoc via ts-for-gir v4.0.0-beta.40
Since 2.80
This functions behaves in the same way as g_once_init_enter(), but can can be used to initialize pointers (or guintptr) instead of gsize.
g_once_init_enter()
guintptr
gsize
static MyStruct *interesting_struct = NULL; if (g_once_init_enter_pointer (&interesting_struct)) { MyStruct *setup_value = allocate_my_struct (); // initialization code here g_once_init_leave_pointer (&interesting_struct, g_steal_pointer (&setup_value)); } // use interesting_struct here Copy
static MyStruct *interesting_struct = NULL; if (g_once_init_enter_pointer (&interesting_struct)) { MyStruct *setup_value = allocate_my_struct (); // initialization code here g_once_init_leave_pointer (&interesting_struct, g_steal_pointer (&setup_value)); } // use interesting_struct here
location of a static initializable variable containing NULL
NULL
true if the initialization section should be entered, false and blocks otherwise
true
false
2.80
This functions behaves in the same way as
g_once_init_enter(), but can can be used to initialize pointers (orguintptr) instead ofgsize.