mirror of
https://github.com/git/git
synced 2024-08-25 10:45:59 +00:00
![Junio C Hamano](/assets/img/avatar_default.png)
Under NO_PTHREADS build, we warn when delta_search_threads is not set to 1, because that is the only sensible value on a single threaded build. However, the auto detection that kicks in when that variable is set to 0 (e.g. there is no configuration variable or command line option, or an explicit --threads=0 is given from the command line to override the pack.threads configuration to force auto-detection) was not done before the condition to issue this warning was tested. Move the auto-detection code and place it at an appropriate spot. Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 lines
241 B
C
16 lines
241 B
C
#ifndef THREAD_COMPAT_H
|
|
#define THREAD_COMPAT_H
|
|
|
|
#ifndef NO_PTHREADS
|
|
#include <pthread.h>
|
|
|
|
extern int online_cpus(void);
|
|
extern int init_recursive_mutex(pthread_mutex_t*);
|
|
|
|
#else
|
|
|
|
#define online_cpus() 1
|
|
|
|
#endif
|
|
#endif /* THREAD_COMPAT_H */
|