summaryrefslogtreecommitdiff
path: root/src/pack.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-04-15 00:09:03 -0700
committerVicent Marti <tanoku@gmail.com>2013-04-22 16:52:07 +0200
commit536078688549ac3d50483eecdec5a8169d921927 (patch)
tree3ceb9965aba3f946b89bbbd99a8071707351d50f /src/pack.h
parent116bbdf0446cd5335b73e691c3352f368eac9b8f (diff)
downloadlibgit2-536078688549ac3d50483eecdec5a8169d921927.tar.gz
Further threading fixes
This builds on the earlier thread safety work to make it so that setting the odb, index, refdb, or config for a repository is done in a threadsafe manner with minimized locking time. This is done by adding a lock to the repository object and using it to guard the assignment of the above listed pointers. The lock is only held to assign the pointer value. This also contains some minor fixes to the other work with pack files to reduce the time that locks are being held to and fix an apparently memory leak.
Diffstat (limited to 'src/pack.h')
-rw-r--r--src/pack.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pack.h b/src/pack.h
index b734ac163..b8014b1ea 100644
--- a/src/pack.h
+++ b/src/pack.h
@@ -79,7 +79,7 @@ typedef struct {
struct git_pack_file {
git_mwindow_file mwf;
git_map index_map;
- git_mutex lock;
+ git_mutex lock; /* protect updates to mwf and index_map */
uint32_t num_objects;
uint32_t num_bad_objects;