Jeff King writes:
> I think this makes sense. It does blur the memory ownership lines of the
> grep_source, though. Can we make that more clear with a comment here:
>
>> +grep_source_init(&gs, GREP_SOURCE_OID, pathbuf.buf, path, oid);
>> +
>> #ifndef NO_PTHREADS
>> if (num_threads) {
>>
On Thu, Feb 15, 2018 at 10:56:13PM +0100, Rasmus Villemoes wrote:
> grep_source_init typically does three strdup()s, and in the threaded
> case, the call from add_work() happens while holding grep_mutex.
>
> We can thus reduce the time we hold grep_mutex by moving the
> grep_source_init() call ou
grep_source_init typically does three strdup()s, and in the threaded
case, the call from add_work() happens while holding grep_mutex.
We can thus reduce the time we hold grep_mutex by moving the
grep_source_init() call out of add_work(), and simply have add_work()
copy the initialized structure to
3 matches
Mail list logo