carb::settings::ScopedWrite

Defined in carb/settings/ISettings.h

class ScopedWrite : public carb::dictionary::ScopedWrite

A helper class for performing a scoped write lock on the settings database.

Public Functions

inline ScopedWrite()

RAII constructor.

Immediately takes a write lock and holds it until *this is destroyed.

Note

Settings locks are recursive.

Warning

If the current thread already owns a read lock (i.e. via ScopedRead), promotion to a write lock necessitates releasing all locks and then waiting for a write lock. This can cause state to change. Always re-evaluate state if this is the case.

~ScopedWrite() = default

Destructor. Releases the write lock.