StaticRecMutex
Object Hierarchy:
Description:
[ CCode ( default_value = "G_STATIC_REC_MUTEX_INIT" , destroy_function = "g_static_rec_mutex_free" , has_type_id = false ) ]
public struct StaticRecMutex
Warning: StaticRecMutex is deprecated since 2.32. Use RecMutex.
A StaticRecMutex works like a StaticMutex, but it can be locked multiple times by one thread.
If you enter it n times, you have to unlock it n times again to let other threads lock it. An exception is the function
g_static_rec_mutex_unlock_full
: that allows you to unlock a StaticRecMutex completely returning the depth,
(i.e. the number of times this mutex was locked). The depth can later be used to restore the state of the StaticRecMutex
by calling lock_full. In GLib 2.32,
StaticRecMutex has been deprecated in favor of RecMutex.
Even though StaticRecMutex is not opaque, it should only be used with the following functions.
All of the g_static_rec_mutex_* functions can be used even if g_thread_init
has not been called. Then they do nothing, apart from
trylock, which does nothing but returning
true.