summaryrefslogtreecommitdiff
path: root/color.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2017-05-25 19:45:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-26 03:52:37 (GMT)
commit8df4c2953f228020438eb53a7d54470c922ce9cc (patch)
tree87a22cf1c766bea75394167f89fcee71147c56ee /color.h
parentd1edee4adac8f516f1545d080fbffcdb148ac7b7 (diff)
downloadgit-8df4c2953f228020438eb53a7d54470c922ce9cc.zip
git-8df4c2953f228020438eb53a7d54470c922ce9cc.tar.gz
git-8df4c2953f228020438eb53a7d54470c922ce9cc.tar.bz2
grep: assert that threading is enabled when calling grep_{lock,unlock}
Change the grep_{lock,unlock} functions to assert that num_threads is true, instead of only locking & unlocking the pthread mutex lock when it is. These functions are never called when num_threads isn't true, this logic has gone through multiple iterations since the initial introduction of grep threading in commit 5b594f457a ("Threaded grep", 2010-01-25), but ever since then they'd only be called if num_threads was true, so this check made the code confusing to read. Replace the check with an assertion, so that it's clear to the reader that this code path is never taken unless we're spawning threads. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'color.h')
0 files changed, 0 insertions, 0 deletions