index-pack: Disable threading on cygwin
The Cygwin implementation of pread() is not thread-safe since, just
like the emulation provided by compat/pread.c, it uses a sequence of
seek-read-seek calls. In order to avoid failues due to thread-safety
issues, commit b038a61 disables threading when NO_PREAD is defined.
(ie when using the emulation code in compat/pread.c).
We introduce a new build variable, NO_THREAD_SAFE_PREAD, which allows
use to disable the threaded index-pack code on cygwin, in addition to
the above NO_PREAD case.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -39,8 +39,8 @@ struct base_data {
|
||||
int ofs_first, ofs_last;
|
||||
};
|
||||
|
||||
#if !defined(NO_PTHREADS) && defined(NO_PREAD)
|
||||
/* NO_PREAD uses compat/pread.c, which is not thread-safe. Disable threading. */
|
||||
#if !defined(NO_PTHREADS) && defined(NO_THREAD_SAFE_PREAD)
|
||||
/* pread() emulation is not thread-safe. Disable threading. */
|
||||
#define NO_PTHREADS
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user