summaryrefslogtreecommitdiff
path: root/src/cache.h
diff options
context:
space:
mode:
authorJustin Spahr-Summers <Justin.SpahrSummers@gmail.com>2014-08-26 15:12:43 -0700
committerJustin Spahr-Summers <Justin.SpahrSummers@gmail.com>2014-08-26 15:12:43 -0700
commit6a211d7c9abbddee342c353092b681b21913b2dd (patch)
tree3bd1d416afe185a593651e867f514306f3252301 /src/cache.h
parent00e9ae5ab4787601a9f3e6ce1ef50ca9c8e60dc9 (diff)
downloadlibgit2-6a211d7c9abbddee342c353092b681b21913b2dd.tar.gz
Refactor git_cache to use an rwlock
This significantly reduces contention when many threads are trying to read from the cache simultaneously.
Diffstat (limited to 'src/cache.h')
-rw-r--r--src/cache.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cache.h b/src/cache.h
index 53fbcf4e9..697123739 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -30,7 +30,7 @@ typedef struct {
typedef struct {
git_oidmap *map;
- git_mutex lock;
+ git_rwlock lock;
ssize_t used_memory;
} git_cache;