ThinSQLite++
A thin, safe and convenient modern C++ wrapper for SQLite API.
|
A mutex adapter for Lockable concept that works with null and non-null mutexes. More...
Public Member Functions | |
lock_adapter (mutex *mutex=nullptr) noexcept | |
Adapt a mutex pointer. | |
lock_adapter (const std::unique_ptr< mutex > &mutex) noexcept | |
Adapt a std::unique_ptr<mutex> | |
void | lock () noexcept |
Lock the mutex. | |
bool | try_lock () noexcept |
Try to lock the mutex. | |
void | unlock () noexcept |
Unlock the mutex. | |
A mutex adapter for Lockable concept that works with null and non-null mutexes.
In many cases SQLite can return nullptr mutexes due to compile-time or runtime disabling of synchronization. This adapter allows you to treat null and non-null mutexes uniformly.
Note that this class stores the passed mutex by reference. If non-null it must remain alive while this class is in use.
|
inlinenoexcept |
Lock the mutex.
Equivalent to sqlite3_mutex_enter
|
inlinenoexcept |
Try to lock the mutex.
Equivalent to sqlite3_mutex_try
|
inlinenoexcept |
Unlock the mutex.
Equivalent to sqlite3_mutex_leave