Commit b3aeb28
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>1 parent 78db6ea commit b3aeb28
3 files changed
Lines changed: 29 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 88 | | |
104 | 89 | | |
105 | 90 | | |
| |||
254 | 239 | | |
255 | 240 | | |
256 | 241 | | |
257 | | - | |
| 242 | + | |
258 | 243 | | |
259 | 244 | | |
260 | 245 | | |
| |||
303 | 288 | | |
304 | 289 | | |
305 | 290 | | |
306 | | - | |
| 291 | + | |
307 | 292 | | |
308 | 293 | | |
309 | 294 | | |
| |||
313 | 298 | | |
314 | 299 | | |
315 | 300 | | |
316 | | - | |
317 | | - | |
318 | 301 | | |
319 | 302 | | |
320 | 303 | | |
| |||
376 | 359 | | |
377 | 360 | | |
378 | 361 | | |
379 | | - | |
| 362 | + | |
380 | 363 | | |
381 | | - | |
| 364 | + | |
382 | 365 | | |
383 | 366 | | |
384 | 367 | | |
| |||
617 | 600 | | |
618 | 601 | | |
619 | 602 | | |
620 | | - | |
| 603 | + | |
621 | 604 | | |
622 | 605 | | |
623 | | - | |
| 606 | + | |
624 | 607 | | |
625 | 608 | | |
626 | 609 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
829 | 835 | | |
830 | 836 | | |
831 | 837 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
142 | 159 | | |
143 | 160 | | |
144 | 161 | | |
0 commit comments