diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-02-14 12:54:20 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-02-14 12:54:20 -0800 |
| commit | 56ceb64eb0377acb2884226d4fb7d7c3f4032354 (patch) | |
| tree | 3ab8775533954b285d1abf67d2ea0f53c7149154 /object.c | |
| parent | 0da63da7942ce810126cd54d9f72a46f3d616895 (diff) | |
| parent | f1928f04b2510c522c25d482e6ab4a17077add9a (diff) | |
| download | git-56ceb64eb0377acb2884226d4fb7d7c3f4032354.tar.xz | |
Merge branch 'mt/threaded-grep-in-object-store'
Traditionally, we avoided threaded grep while searching in objects
(as opposed to files in the working tree) as accesses to the object
layer is not thread-safe. This limitation is getting lifted.
* mt/threaded-grep-in-object-store:
grep: use no. of cores as the default no. of threads
grep: move driver pre-load out of critical section
grep: re-enable threads in non-worktree case
grep: protect packed_git [re-]initialization
grep: allow submodule functions to run in parallel
submodule-config: add skip_if_read option to repo_read_gitmodules()
grep: replace grep_read_mutex by internal obj read lock
object-store: allow threaded access to object reading
replace-object: make replace operations thread-safe
grep: fix racy calls in grep_objects()
grep: fix race conditions at grep_submodule()
grep: fix race conditions on userdiff calls
Diffstat (limited to 'object.c')
| -rw-r--r-- | object.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -480,6 +480,7 @@ struct raw_object_store *raw_object_store_new(void) memset(o, 0, sizeof(*o)); INIT_LIST_HEAD(&o->packed_git_mru); hashmap_init(&o->pack_map, pack_map_entry_cmp, NULL, 0); + pthread_mutex_init(&o->replace_mutex, NULL); return o; } @@ -507,6 +508,7 @@ void raw_object_store_clear(struct raw_object_store *o) oidmap_free(o->replace_map, 1); FREE_AND_NULL(o->replace_map); + pthread_mutex_destroy(&o->replace_mutex); free_commit_graph(o->commit_graph); o->commit_graph = NULL; |
