Optionalproperties: Partial<{}>Since 2.32clearFrees the resources allocated to a recursive mutex with
g_rec_mutex_init().
This function should not be used with a GLib.RecMutex that has been statically allocated.
Calling g_rec_mutex_clear() on a locked recursive mutex leads
to undefined behaviour.
Since 2.32initInitializes a GLib.RecMutex so that it can be used.
This function is useful to initialize a recursive mutex that has been allocated on the stack, or as part of a larger structure.
It is not necessary to initialise a recursive mutex that has been statically allocated.
typedef struct {
GRecMutex m;
...
} Blob;
Blob *b;
b = g_new (Blob, 1);
g_rec_mutex_init (&b->m);
Calling g_rec_mutex_init() on an already initialized GLib.RecMutex
leads to undefined behaviour.
To undo the effect of g_rec_mutex_init() when a recursive mutex
is no longer needed, use g_rec_mutex_clear().
Since 2.32lockLocks rec_mutex. If rec_mutex is already locked by another
thread, the current thread will block until rec_mutex is
unlocked by the other thread. If rec_mutex is already locked
by the current thread, the 'lock count' of rec_mutex is increased.
The mutex will only become available again when it is unlocked
as many times as it has been locked.
Since 2.32trylockSince 2.32unlock
The GRecMutex struct is an opaque data structure to represent a recursive mutex. It is similar to a GLib.Mutex with the difference that it is possible to lock a GRecMutex multiple times in the same thread without deadlock. When doing so, care has to be taken to unlock the recursive mutex as often as it has been locked.
If a GLib.RecMutex is allocated in static storage then it can be used without initialisation. Otherwise, you should call
g_rec_mutex_init()on it andg_rec_mutex_clear()when done.A GRecMutex should only be accessed with the g_rec_mutex_ functions.
Since
2.32