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

Re: thread-utils: build with NO_PTHREADS fails

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 12, 2015, 15:57 UTC
Message-ID
<xmqq7fmsnkp9.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<6AE1604EE3EC5F4296C096518C6B77EE5D0FDAB9E8@mail.accesssoftek.com>
Victor Leschuk <vleschuk@accesssoftek.com> writes:
Show 23 quoted lines
> I think that no one tried it for a long time but I needed a
> single-threaded git version for debug purpose. I tried to build
> with -DNO_PTHREADS and thread-utils.c failed to compile.
>
> In brief the situation is the following:
>
> in header file we have something like that:
>
>
> #ifndef NO_PTHREAD
> extern int online_cpus(void);
>
> #else
> #define online_cpus() 1
> #endif // NO_PTHREAD
>
> and in *.c file:
>
>
> int online_cpus(void)
> {
>     // ...
> }
Yeah, that is obviously incorrect.

The whole implementation of thread-utils.c should be enabled only under ifndef NO_PTHREADS and thread-utils.h should also privide a no-op macro for init_recursive_mutex() just like it already does for online_cpus(), which would make it unnecessary to have ifndef NO_PTHREADS sprinkled all over the place inside thread-utils.c, no?

Previous: Victor LeschukNext: Junio C Hamano
Message 2 of 4 in “thread-utils: build with NO_PTHREADS fails”
  1. Victor LeschukOct 11, 2015
  2. Junio C HamanoOct 12, 2015
  3. Junio C HamanoOct 12, 2015
  4. Victor LeschukOct 14, 2015

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.