Initializes a #GRWLock so that it can be used.
This function is useful to initialize a lock that has been allocated on the stack, or as part of a larger structure. It is not necessary to initialise a reader-writer lock that has been statically allocated.
|[<!-- language="C" --> typedef struct { GRWLock l; ... } Blob;
Blob *b;
b = g_new (Blob, 1); g_rw_lock_init (&b->l); ]|
To undo the effect of g_rw_lock_init() when a lock is no longer needed, use g_rw_lock_clear().
Calling g_rw_lock_init() on an already initialized #GRWLock leads to undefined behaviour.
2.32
See Implementation
Initializes a #GRWLock so that it can be used.
This function is useful to initialize a lock that has been allocated on the stack, or as part of a larger structure. It is not necessary to initialise a reader-writer lock that has been statically allocated.
|[<!-- language="C" --> typedef struct { GRWLock l; ... } Blob;
Blob *b;
b = g_new (Blob, 1); g_rw_lock_init (&b->l); ]|
To undo the effect of g_rw_lock_init() when a lock is no longer needed, use g_rw_lock_clear().
Calling g_rw_lock_init() on an already initialized #GRWLock leads to undefined behaviour.