|
|
mutex | exclusive_lock |
|
atomic< idx_t > | read_count |
|
| enable_shared_from_this & | operator= (enable_shared_from_this const &) noexcept |
◆ StorageLockInternals()
| duckdb::StorageLockInternals::StorageLockInternals |
( |
| ) |
|
|
inline |
426087 : read_count(0) {
426088 }
◆ GetExclusiveLock()
426094 {
426095 exclusive_lock.lock();
426096 while (read_count != 0) {
426097 }
426098 return make_uniq<StorageLockKey>(shared_from_this(), StorageLockType::EXCLUSIVE);
426099 }
◆ GetSharedLock()
426101 {
426102 exclusive_lock.lock();
426103 read_count++;
426104 exclusive_lock.unlock();
426105 return make_uniq<StorageLockKey>(shared_from_this(), StorageLockType::SHARED);
426106 }
◆ TryGetExclusiveLock()
426108 {
426109 if (!exclusive_lock.try_lock()) {
426110
426111 return nullptr;
426112 }
426113 if (read_count != 0) {
426114
426115 exclusive_lock.unlock();
426116 return nullptr;
426117 }
426118
426119 return make_uniq<StorageLockKey>(shared_from_this(), StorageLockType::EXCLUSIVE);
426120 }
◆ TryUpgradeCheckpointLock()
426122 {
426123 if (lock.GetType() != StorageLockType::SHARED) {
426124 throw InternalException("StorageLock::TryUpgradeLock called on an exclusive lock");
426125 }
426126 if (!exclusive_lock.try_lock()) {
426127
426128 return nullptr;
426129 }
426130 if (read_count != 1) {
426131
426132 D_ASSERT(read_count != 0);
426133 exclusive_lock.unlock();
426134 return nullptr;
426135 }
426136
426137 return make_uniq<StorageLockKey>(shared_from_this(), StorageLockType::EXCLUSIVE);
426138 }
◆ ReleaseExclusiveLock()
| void duckdb::StorageLockInternals::ReleaseExclusiveLock |
( |
| ) |
|
|
inline |
426140 {
426141 exclusive_lock.unlock();
426142 }
◆ ReleaseSharedLock()
| void duckdb::StorageLockInternals::ReleaseSharedLock |
( |
| ) |
|
|
inline |
426143 {
426144 read_count--;
426145 }
The documentation for this struct was generated from the following file: