From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "Kristian Høgsberg" <krh@redhat.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] Fix config lockfile handling.
Date: Fri, 14 Dec 2007 13:18:30 -0800 [thread overview]
Message-ID: <7vwsrhotzt.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0712142015240.27959@racer.site> (Johannes Schindelin's message of "Fri, 14 Dec 2007 20:15:54 +0000 (GMT)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> > AFAICT this cannot work. At least not reliably. An atexit() handler
>> > will access all (even closed) lockfiles.
>>
>> Correct. It cannot be on the stack.
>
> Note that this behaviour will be another obstacle to libification.
By your definition of "obstacle", there is no work at all in
libification if the system is obstacle free.
Libification is all about removing run-once-and-exit and atexit() is
just a part of it.
I think we can do this step-by-step by first introducing a new function
"get_lockfile()" that takes a list of active lockfiles (perhaps that
would be a part of "client context" thing in the library) and gives back
a lockfile structure allocated on heap, registers it to the list of
lockfiles that need to be eventually cleaned up, and another function
"rollback_lockfiles()" that take the list of lockfiles in the "client
context" and rolls them all back. Once there is such a "client contex",
in the current unlibified "main" routines can then declare a global
client context, obtain and use lockfiles for that context, and directly
call rollback_lockfiles() from the atexit() handler.
But that is all post 1.5.4.
next prev parent reply other threads:[~2007-12-14 21:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-14 19:22 config.c fixes Kristian Høgsberg
2007-12-14 19:22 ` [PATCH 1/2] Fix config lockfile handling Kristian Høgsberg
2007-12-14 19:22 ` [PATCH 2/2] Use a strbuf for building up section header and key/value pair strings Kristian Høgsberg
2007-12-14 19:29 ` [PATCH 1/2] Fix config lockfile handling Johannes Schindelin
2007-12-14 20:07 ` Junio C Hamano
2007-12-14 20:15 ` Johannes Schindelin
2007-12-14 21:18 ` Junio C Hamano [this message]
2007-12-14 19:32 ` Johannes Sixt
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=7vwsrhotzt.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=krh@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).