From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Johannes Sixt <j6t@kdbg.org>,
Jacob Keller <jacob.keller@gmail.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
"git\@vger.kernel.org" <git@vger.kernel.org>,
Simon Ruderich <simon@ruderich.org>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] compat: Allow static initializer for pthreads on Windows
Date: Fri, 28 Oct 2016 13:38:02 -0700 [thread overview]
Message-ID: <xmqqmvhoyzth.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kZVivquVDH9S63K8p3bOis+e=b3cKVVrg13zPe_BrL_Sw@mail.gmail.com> (Stefan Beller's message of "Fri, 28 Oct 2016 13:36:05 -0700")
Stefan Beller <sbeller@google.com> writes:
> On Fri, Oct 28, 2016 at 1:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Johannes Sixt <j6t@kdbg.org> writes:
>>
>>> Another problem with the proposed patch is that there is no
>>> declaration for attr_start() before the call in compat/mingw.c. We
>>> would have to move the declaration of attr_start() to cache.h (for
>>> example), because #including attr.h in compat/mingw.c is plainly
>>> wrong. However, it would not be a major offense to #include attr.h in
>>> common-main.c. But when we do that, we can certainly spare the few
>>> cycles to call pthread_mutex_init.
>>
>> That sounds like a good argument to have it in common-main.c.
>
> If we're going that route, I would get rid of PTHREAD_MUTEX_INITILIZER
> and call a pthread_mutex_init platform independently.
Yup, but earlier j6t was trying hard not to penalize any single
platform, and that would certainly penalize the ones with static
initialization, so I was hoping to hear if there is a clever
workaround to avoid that.
>> Would it mean that the code that defines the mutex needs to have
>> #ifdef that defines a no-op attr_start() and defines the mutex with
>> PTHREAD_MUTEX_INITILIZER with #else that just defines the mutex
>> without initializatin, with the real attr_start(), though?
next prev parent reply other threads:[~2016-10-28 20:38 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-26 21:57 [PATCH] compat: Allow static initializer for pthreads on Windows Stefan Beller
2016-10-26 22:14 ` Stefan Beller
2016-10-27 5:49 ` Johannes Sixt
2016-10-27 6:02 ` Junio C Hamano
2016-10-27 6:10 ` Johannes Sixt
2016-10-27 6:21 ` Junio C Hamano
2016-10-27 6:29 ` Johannes Sixt
2016-10-27 6:33 ` Junio C Hamano
2016-10-27 17:01 ` Stefan Beller
2016-10-27 17:11 ` Jeff King
2016-10-27 18:22 ` Johannes Sixt
2016-10-27 18:49 ` Junio C Hamano
2016-10-27 19:08 ` Stefan Beller
2016-10-27 20:05 ` Johannes Sixt
2016-10-27 21:49 ` Jacob Keller
2016-10-27 21:59 ` Stefan Beller
2016-10-28 5:55 ` Johannes Sixt
2016-10-28 6:11 ` Jacob Keller
2016-10-28 13:01 ` Philip Oakley
2016-10-28 18:49 ` Jacob Keller
2016-10-28 11:58 ` Johannes Schindelin
2016-10-28 18:48 ` Jacob Keller
2016-10-28 20:26 ` Johannes Sixt
2016-10-28 20:29 ` Junio C Hamano
2016-10-28 20:36 ` Stefan Beller
2016-10-28 20:38 ` Junio C Hamano [this message]
2016-10-28 20:49 ` Johannes Sixt
2016-10-28 20:52 ` Junio C Hamano
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=xmqqmvhoyzth.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=jacob.keller@gmail.com \
--cc=peff@peff.net \
--cc=sbeller@google.com \
--cc=simon@ruderich.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.