GLib.MainContext.prototype.wait

function wait(cond: GLib.Cond, mutex: GLib.Mutex): Boolean {
    // Gjs wrapper for g_main_context_wait()
}
  

Tries to become the owner of the specified context, as with GLib.MainContext.prototype.acquire. But if another thread is the owner, atomically drop mutex and wait on cond until that owner releases ownership or until cond is signaled, then try again (once) to become the owner.

cond

a condition variable

mutex

a mutex, currently held

Returns

true if the operation succeeded, and this thread is now the owner of context.