author | Jeff King <peff@peff.net> | |
Thu, 2 Feb 2012 08:18:41 +0000 (03:18 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 2 Feb 2012 18:36:07 +0000 (10:36 -0800) | ||
commit | b3aeb285d0ac1dcb4d578a61a68e08646f96501f | |
tree | f299d6f58379e87987f0029d6bed85b7b9719005 | tree | snapshot |
parent | 78db6ea9dc1a872f9d07a36fe7aec700a5c963b9 | commit | diff |
grep: move sha1-reading mutex into low-level code
The multi-threaded git-grep code needs to serialize access
to the thread-unsafe read_sha1_file call. It does this with
a mutex that is local to builtin/grep.c.
Let's instead push this down into grep.c, where it can be
used by both builtin/grep.c and grep.c. This will let us
safely teach the low-level grep.c code tricks that involve
reading from the object db.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The multi-threaded git-grep code needs to serialize access
to the thread-unsafe read_sha1_file call. It does this with
a mutex that is local to builtin/grep.c.
Let's instead push this down into grep.c, where it can be
used by both builtin/grep.c and grep.c. This will let us
safely teach the low-level grep.c code tricks that involve
reading from the object db.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c | diff | blob | history | |
grep.c | diff | blob | history | |
grep.h | diff | blob | history |