Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] git grep: be careful to use mutices only when they are initialized

From: René Scharfe <hidden>
Date: 2016-06-15 22:52:20

Possibly related (same subject, not in this thread)

Am 26.10.2011 22:08, schrieb Junio C Hamano:
Junio C Hamano [off-list ref] writes:
quoted
The remainder of this message are hints and random thoughts on potential
follow-up patches that may want to build on top of this patch for further
clean-ups (not specifically meant for Dscho but for other people on both
mailing lists).
...
 - Could we lose "#ifndef NO_PTHREADS" inside grep_sha1(), grep_file(),
   and possibly cmd_grep() functions and let the compiler optimize things
   away under NO_PTHREADS compilation?
I suspect that the result of the conversion would look a lot cleaner if
the code is first cleaned up to move global variable like skip_first_line
and the mutexes into the grep_opt structure. Without such clean-up, I do
not think a conversion like this does not add much value.
Each thread get its own copy of the grep_opt struct, but the mutexes and
also skip_first_line must not be duplicated.  They could be moved into a
new struct that is pointed to by grep_opt, but I'm not sure it's a win.

René
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help