Thread (1 message) 1 message, 1 author, 2016-06-15

Re: thread-utils: build with NO_PTHREADS fails

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:06:49

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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help