glibmm 2.66.10

Public Member Functions | Related Symbols | List of all members
Glib::StaticMutex Struct Reference

Like Glib::Mutex, but can be defined at compile time. More...

`#include <glibmm/thread.h>`

## Public Member Functions
void | lock ()
bool | trylock ()
void | unlock ()
| operator Mutex & ()
GStaticMutex * | gobj ()

## Related Symbols
(Note that these are not member symbols.)
#define | GLIBMM_STATIC_MUTEX_INIT
| Initializer macro for Glib::StaticMutex.

## Detailed Description

Like Glib::Mutex, but can be defined at compile time.

Use `GLIBMM_STATIC_MUTEX_INIT` to initialize a StaticMutex:

Glib::StaticMutex mutex = GLIBMM_STATIC_MUTEX_INIT;
Glib::StaticMutex
Like Glib::Mutex, but can be defined at compile time.
Definition thread.h:396
Glib::StaticMutex::GLIBMM_STATIC_MUTEX_INIT
#define GLIBMM_STATIC_MUTEX_INIT
Initializer macro for Glib::StaticMutex.
Definition thread.h:417

A StaticMutex can be used without calling Glib::thread_init(), it will silently do nothing then. That will also work when using the implicit conversion to Mutex&, thus you can safely use Mutex::Lock with a StaticMutex.

Deprecated
  Use Glib::Threads::Mutex instead, which can be used statically.

## Member Function Documentation

## ◆ gobj()

GStaticMutex * Glib::StaticMutex::gobj | ( |  | ) |
| inline

## ◆ lock()

void Glib::StaticMutex::lock | ( |  | ) |

## ◆ operator Mutex &()

Glib::StaticMutex::operator Mutex & | ( |  | ) |

## ◆ trylock()

bool Glib::StaticMutex::trylock | ( |  | ) |

## ◆ unlock()

void Glib::StaticMutex::unlock | ( |  | ) |

## Friends And Related Symbol Documentation

## ◆ GLIBMM_STATIC_MUTEX_INIT

#define GLIBMM_STATIC_MUTEX_INIT
| related

Initializer macro for Glib::StaticMutex.

Deprecated
  Glib::StaticMutex is deprecated in favour of Glib::Threads::Mutex, which can be used statically.