diff options
author | Russell Belfer <rb@github.com> | 2014-02-08 16:42:26 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-04-17 14:43:45 -0700 |
commit | dac160489bbf8de90d2f1ae152df68ded2603598 (patch) | |
tree | 527d52fa619a8b4ea43aefcb1feb503945d8ae50 /src/index.h | |
parent | 54edbb9871ad543baefc62310512719fc70539be (diff) | |
download | libgit2-dac160489bbf8de90d2f1ae152df68ded2603598.tar.gz |
Add mutex around index entries changes
This surrounds any function that mutates the entries vector with
a mutex so it can be safely snapshotted.
Diffstat (limited to 'src/index.h')
-rw-r--r-- | src/index.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/index.h b/src/index.h index 2b6f5c98b..c2a932218 100644 --- a/src/index.h +++ b/src/index.h @@ -21,12 +21,15 @@ struct git_index { git_refcount rc; char *index_file_path; - git_futils_filestamp stamp; + git_vector entries; - unsigned int on_disk:1; + git_mutex lock; /* lock held while entries is being changed */ + git_vector deleted; /* deleted entries if readers > 0 */ + git_atomic readers; /* number of active iterators */ + unsigned int on_disk:1; unsigned int ignore_case:1; unsigned int distrust_filemode:1; unsigned int no_symlinks:1; |