Re: thread-utils: build with NO_PTHREADS fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Victor Leschuk <vleschuk@xxxxxxxxxxxxxxxx> 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?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]