Victor Leschuk [off-list ref] writes:
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?