Skip to content

Commit e500584

Browse files
committed
LedgerDB.V2: add haddocks for ldbOpenHandlesLock
1 parent 887c11b commit e500584

File tree

1 file changed

+6
-0
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB

1 file changed

+6
-0
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,12 @@ data LedgerDBEnv m l blk = LedgerDBEnv
458458
, ldbResolveBlock :: !(ResolveBlock m blk)
459459
, ldbQueryBatchSize :: !QueryBatchSize
460460
, ldbOpenHandlesLock :: !(RAWLock m LDBLock)
461+
-- ^ While holding a read lock (at least), all handles in the 'ldbSeq' are
462+
-- guaranteed to be open. During this time, the handle can be duplicated and
463+
-- then be used independently, see 'getStateRef' and 'withStateRef'.
464+
--
465+
-- Therefore, closing any handles which were previously in 'ldbSeq' requires
466+
-- acquiring a write lock.
461467
}
462468
deriving Generic
463469

0 commit comments

Comments
 (0)