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

Re: [PATCH v3] simple-ipc: correct ifdefs when NO_PTHREADS is defined

From
Junio C Hamano <gitster@pobox.com>
Date
May 20, 2021, 23:01 UTC
Message-ID
<xmqq5yzdt3fc.fsf@gitster.g>
In-Reply-To
<pull.955.v3.git.1621535291406.gitgitgadget@gmail.com>
"Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 27 quoted lines
>  Makefile                            | 22 ++++++++++++++++++++--
>  compat/simple-ipc/ipc-shared.c      | 10 +++++++---
>  compat/simple-ipc/ipc-unix-socket.c |  8 ++++++--
>  compat/simple-ipc/ipc-win32.c       |  8 ++++++--
>  contrib/buildsystems/CMakeLists.txt | 10 +++++++++-
>  simple-ipc.h                        |  4 ----
>  6 files changed, 48 insertions(+), 14 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 3a2d3c80a81a..ea4c0a77604d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1687,13 +1687,31 @@ ifdef NO_UNIX_SOCKETS
>  else
>  	LIB_OBJS += unix-socket.o
>  	LIB_OBJS += unix-stream-server.o
> -	LIB_OBJS += compat/simple-ipc/ipc-shared.o
> -	LIB_OBJS += compat/simple-ipc/ipc-unix-socket.o
>  endif
>  
> +# Simple IPC requires threads and platform-specific IPC support.
> +# Only platforms that have both should include these source files
> +# in the build.
> +#
> +# On Windows-based systems, Simple IPC requires threads and Windows
> +# Named Pipes.  These are always available, so Simple IPC support
> +# is optional.

The last part for windows feels funny in that even if they were not always available, the builder can still choose to compile Simple IPC support out, hence it is optional (this is true for both Windows and others). In other words, "prereqs are always satisified" does not lead to "hence it is optional".

But let's leave it as-is. We could rewrite it to "..., so Simple IPC is always enabled", though.

> +#
> +# On Unix-based systems, Simple IPC requires pthreads and Unix
> +# domain sockets.  So support is only enabled when both are present.
Other than that, looks good to me.
Will queue.
Previous: Jeff Hostetler via GitGitGadget
Message 8 of 8 in “simple-ipc: correct ifdefs when NO_PTHREADS is defined”
  1. simple-ipc: correct ifdefs when NO_PTHREADS is definedJeff Hostetler via GitGitGadget, May 18, 2021
  2. Junio C HamanoMay 19, 2021
  3. Jeff HostetlerMay 19, 2021
  4. Junio C HamanoMay 19, 2021
  5. simple-ipc: correct ifdefs when NO_PTHREADS is definedJeff Hostetler via GitGitGadget, May 20, 2021
  6. Jeff HostetlerMay 20, 2021
  7. simple-ipc: correct ifdefs when NO_PTHREADS is definedJeff Hostetler via GitGitGadget, May 20, 2021
  8. Junio C HamanoMay 20, 2021

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.