///|
/// An owned GLib mutex.
///
/// The mutex is initialized on construction and cleared when its MoonBit
/// wrapper is collected. It is non-recursive, matching `GMutex`.
pub type Mutex

///|
/// Creates an initialized mutex.
pub extern "c" fn Mutex::new() -> Mutex = "moonbit_glib_mutex_new"

///|
/// Blocks until this mutex is acquired.
#borrow(self)
pub extern "c" fn Mutex::lock(self : Mutex) -> Unit = "moonbit_glib_mutex_lock"

///|
/// Attempts to acquire this mutex without blocking.
#borrow(self)
pub extern "c" fn Mutex::try_lock(self : Mutex) -> Bool = "moonbit_glib_mutex_try_lock"

///|
/// Releases a mutex held by the current thread.
#borrow(self)
pub extern "c" fn Mutex::unlock(self : Mutex) -> Unit = "moonbit_glib_mutex_unlock"