glibmm 2.34.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | List of all members
Glib::Threads::RWLock Class Reference
Threads

This represents a reader-writer lock. More...

`#include <glibmm/threads.h>`

## Classes

class | ReaderLock
| Utility class for exception-safe locking of read/write locks. More...
class | WriterLock
| Utility class for exception-safe locking of read/write locks. More...

## Public Member Functions

| RWLock ()
| ~RWLock ()
void | reader_lock ()
bool | reader_trylock ()
void | reader_unlock ()
void | writer_lock ()
bool | writer_trylock ()
void | writer_unlock ()
GRWLock* | gobj ()

## Detailed Description

This represents a reader-writer lock.

It is similar to a Mutex in that it allows multiple threads to coordinate access to a shared resource.

The difference to a mutex is that a reader-writer lock discriminates between read-only ('reader') and full ('writer') access. While only one thread at a time is allowed write access (by holding the 'writer' lock via writer_lock()), multiple threads can gain simultaneous read-only access (by holding the 'reader' lock via reader_lock()).

## Constructor & Destructor Documentation

Glib::Threads::RWLock::RWLock | ( |  | ) |

Glib::Threads::RWLock::~RWLock | ( |  | ) |

## Member Function Documentation

GRWLock* Glib::Threads::RWLock::gobj | ( |  | ) |

inline

void Glib::Threads::RWLock::reader_lock | ( |  | ) |

bool Glib::Threads::RWLock::reader_trylock | ( |  | ) |

void Glib::Threads::RWLock::reader_unlock | ( |  | ) |

void Glib::Threads::RWLock::writer_lock | ( |  | ) |

bool Glib::Threads::RWLock::writer_trylock | ( |  | ) |

void Glib::Threads::RWLock::writer_unlock | ( |  | ) |