From: Junio C Hamano <gitster@pobox•com>
To: Johannes Schindelin <Johannes.Schindelin@gmx•de>
Cc: Heiko Voigt <hvoigt@hvoigt•net>,
Fredrik Kuivinen <frekui@gmail•com>,
git@vger•kernel.org, Nicolas Pitre <nico@fluxnic•net>
Subject: Re: [PATCH] fix threaded grep for machines with only one cpu
Date: Tue, 16 Feb 2010 17:26:06 -0800 [thread overview]
Message-ID: <7vvddwodox.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.DEB.1.00.1002170200370.20986@pacific.mpi-cbg.de> (Johannes Schindelin's message of "Wed\, 17 Feb 2010 02\:01\:03 +0100 \(CET\)")
Johannes Schindelin <Johannes.Schindelin@gmx•de> writes:
>> The program can decide at runtime not to use threading even if the support
>> is compiled in. In such a case, mutexes are not necessary and left
>> uninitialized. But the code incorrectly tried to take and release the
>> read_sha1_mutex unconditionally.
>>
>> Signed-off-by: Junio C Hamano <gitster@pobox•com>
>> Acked-by: Fredrik Kuivinen <frekui@gmail•com>
>> ---
>
> Yes, this one looks much, much nicer.
The structure may be much nicer, but one remaining thing is that I do not
think foo_locked() is a good name; IIRC, kernel folks use _locked() suffix
when the caller is expected to already hold the lock. So a typical naming
convention goes like this:
foo()
{
lock();
foo_locked();
unlock();
}
but what the patch did was the other way around:
read_sha1_file_locked()
{
lock();
read_sha1_file();
unlock();
}
which is probably against the convention many readers of our codebase are
already familiar with.
We need a better name to unconfuse people, I think.
next prev parent reply other threads:[~2010-02-17 1:26 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-15 22:50 [PATCH] fix threaded grep for machines with only one cpu Heiko Voigt
2010-02-15 23:09 ` Johannes Schindelin
2010-02-16 1:07 ` Junio C Hamano
2010-02-16 1:12 ` Junio C Hamano
2010-02-16 2:32 ` Junio C Hamano
2010-02-16 2:39 ` Junio C Hamano
2010-02-16 7:54 ` Fredrik Kuivinen
2010-02-16 8:15 ` Johannes Schindelin
2010-02-16 23:59 ` Junio C Hamano
2010-02-17 1:01 ` Johannes Schindelin
2010-02-17 1:26 ` Junio C Hamano [this message]
2010-02-17 2:41 ` Nicolas Pitre
2010-02-17 22:43 ` Heiko Voigt
2010-02-18 9:10 ` Johannes Schindelin
2010-02-16 18:02 ` Heiko Voigt
2010-02-16 18:59 ` Nicolas Pitre
2010-02-16 19:20 ` Junio C Hamano
2010-02-16 19:26 ` Sverre Rabbelier
2010-02-16 20:00 ` Nicolas Pitre
2010-02-16 20:19 ` Johannes Schindelin
2010-02-16 20:37 ` Nicolas Pitre
2010-02-16 20:57 ` Heiko Voigt
2010-02-16 21:20 ` Nicolas Pitre
2010-02-16 22:54 ` Junio C Hamano
2010-02-17 17:56 ` Heiko Voigt
2010-02-17 15:29 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vvddwodox.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox$(echo .)com \
--cc=Johannes.Schindelin@gmx$(echo .)de \
--cc=frekui@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=hvoigt@hvoigt$(echo .)net \
--cc=nico@fluxnic$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox