git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: lockfiles & fork()

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 28, 2006, 01:52 UTC
Message-ID
<Pine.LNX.4.64.0610271851130.3849@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.63.0610280319250.26682@wbgn013.biozentrum.uni-wuerzburg.de>
On Sat, 28 Oct 2006, Johannes Schindelin wrote:
> 
> when you setup a lockfile, and then fork(), you could easily end up with 
> atexit() kicking in to remove the lockfile, before the main process has a 
> chance to commit. (Yes, I need to hold the lock long before the fork()).

The easiest way to handle this would be for the lockfile logic to just save the pid associated with each lockfile... And for the atexit function to just ignore it if the pid doesn't match.

Previous: Junio C HamanoNext: Florian Weimer
Message 3 of 4 in “lockfiles & fork()”
  1. Johannes SchindelinOct 28, 2006
  2. Junio C HamanoOct 28, 2006
  3. Linus TorvaldsOct 28, 2006
  4. Florian WeimerOct 28, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.