|
Tkrzw
|
Scoped lock with a mutex for a hash table. More...
#include <tkrzw_thread_util.h>
Public Member Functions | |
| ScopedHashLock (HashMutex &mutex, std::string_view data, bool writable) | |
| Constructor to lock one bucket. More... | |
| ScopedHashLock (HashMutex &mutex, bool writable) | |
| Constructro to lock all buckets. More... | |
| ScopedHashLock (HashMutex &mutex, int64_t bucket_index, bool writable) | |
| Constructor to lock the bucket specific to an index. More... | |
| ~ScopedHashLock () | |
| Destructor. More... | |
| int64_t | GetBucketIndex () const |
| Gets the index of the bucket. More... | |
Scoped lock with a mutex for a hash table.
| tkrzw::ScopedHashLock::ScopedHashLock | ( | HashMutex & | mutex, |
| std::string_view | data, | ||
| bool | writable | ||
| ) |
Constructor to lock one bucket.
| mutex | A hash mutex. |
| data | The data to be set in the hash table. |
| writable | True for exclusive lock or false for shared lock. |
| tkrzw::ScopedHashLock::ScopedHashLock | ( | HashMutex & | mutex, |
| bool | writable | ||
| ) |
Constructro to lock all buckets.
| mutex | A hash mutex. |
| writable | True for exclusive lock or false for shared lock. |
| tkrzw::ScopedHashLock::ScopedHashLock | ( | HashMutex & | mutex, |
| int64_t | bucket_index, | ||
| bool | writable | ||
| ) |
Constructor to lock the bucket specific to an index.
| mutex | A hash mutex. |
| bucket_index | The index of the bucket to lock. |
| writable | True for exclusive lock or false for shared lock. |
Only this constructor can fail. It is because of rehashing.
| tkrzw::ScopedHashLock::~ScopedHashLock | ( | ) |
Destructor.
| int64_t tkrzw::ScopedHashLock::GetBucketIndex | ( | ) | const |
Gets the index of the bucket.
1.8.14