From: Joey Hess Date: Wed, 16 Dec 2015 17:24:45 +0000 (-0400) Subject: comment X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~320^2~184^2~31 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1a051f4300f9ae56e93527485b1aa7cc0fd12332;p=git-annex.git comment --- diff --git a/Database/Keys.hs b/Database/Keys.hs index 62c7c25eb4..d4b5b33574 100644 --- a/Database/Keys.hs +++ b/Database/Keys.hs @@ -54,7 +54,14 @@ Content KeyCacheIndex key cache |] -{- Opens the database, creating it if it doesn't exist yet. -} +{- Opens the database, creating it if it doesn't exist yet. + - + - Multiple readers and writers can have the database open at the same + - time. Database.Handle deals with the concurrency issues. + - The lock is held while opening the database, so that when + - the database doesn't exist yet, one caller wins the lock and + - can create it undisturbed. + -} openDb :: Annex DbHandle openDb = withExclusiveLock gitAnnexKeysDbLock $ do dbdir <- fromRepo gitAnnexKeysDb