]> source.dussan.org Git - jgit.git/commit
DfsObjectDatabase: Expose PackList and move markDirty there 21/77321/5
authorDave Borowitz <dborowitz@google.com>
Thu, 14 Jul 2016 16:11:51 +0000 (12:11 -0400)
committerDave Borowitz <dborowitz@google.com>
Mon, 18 Jul 2016 19:57:41 +0000 (15:57 -0400)
commit0f1c361e62db3e685cc9b81733fe2cfd794a9e99
tree185c138487fb1bedad35da777ea6df736d658f9f
parent18e9db306b52d2b49c78d0558d51f4a04cca1764
DfsObjectDatabase: Expose PackList and move markDirty there

What's invalidated when an object database is "dirty" is not the whole
database, but rather a specific list of packs. If there is a race
between getting the pack list and setting the volatile dirty flag
where the packs are rescanned, we don't need to mark the new pack list
as dirty.

This is a fine point that only really applies if the decision of
whether or not to mark dirty actually requires introspecting the pack
list (say, its timestamps). The general operation of "take whatever
is the current pack list and mark it dirty" may still be inherently
racy, but the cost is not so high.

Change-Id: I159e9154bd8b2d348b4e383627a503e85462dcc6
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java