Merge branch 'rj/platform-pread-may-be-thread-unsafe' into maint
On Cygwin, the platform pread(2) is not thread safe, just like our own compat/ emulation, and cannot be used in the index-pack program. Makefile variable NO_THREAD_SAFE_PREAD can be defined to avoid use of this function in a threaded program. * rj/platform-pread-may-be-thread-unsafe: index-pack: Disable threading on cygwin
This commit is contained in:
commit
2e1e8efcc7
8
Makefile
8
Makefile
@ -158,6 +158,9 @@ all::
|
|||||||
# Define NO_PREAD if you have a problem with pread() system call (e.g.
|
# Define NO_PREAD if you have a problem with pread() system call (e.g.
|
||||||
# cygwin1.dll before v1.5.22).
|
# cygwin1.dll before v1.5.22).
|
||||||
#
|
#
|
||||||
|
# Define NO_THREAD_SAFE_PREAD if your pread() implementation is not
|
||||||
|
# thread-safe. (e.g. compat/pread.c or cygwin)
|
||||||
|
#
|
||||||
# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
|
# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
|
||||||
# generally faster on your platform than accessing the working directory.
|
# generally faster on your platform than accessing the working directory.
|
||||||
#
|
#
|
||||||
@ -1051,6 +1054,7 @@ ifeq ($(uname_O),Cygwin)
|
|||||||
NO_IPV6 = YesPlease
|
NO_IPV6 = YesPlease
|
||||||
OLD_ICONV = UnfortunatelyYes
|
OLD_ICONV = UnfortunatelyYes
|
||||||
endif
|
endif
|
||||||
|
NO_THREAD_SAFE_PREAD = YesPlease
|
||||||
NEEDS_LIBICONV = YesPlease
|
NEEDS_LIBICONV = YesPlease
|
||||||
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
|
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
|
||||||
NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
|
NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
|
||||||
@ -1659,6 +1663,10 @@ endif
|
|||||||
ifdef NO_PREAD
|
ifdef NO_PREAD
|
||||||
COMPAT_CFLAGS += -DNO_PREAD
|
COMPAT_CFLAGS += -DNO_PREAD
|
||||||
COMPAT_OBJS += compat/pread.o
|
COMPAT_OBJS += compat/pread.o
|
||||||
|
NO_THREAD_SAFE_PREAD = YesPlease
|
||||||
|
endif
|
||||||
|
ifdef NO_THREAD_SAFE_PREAD
|
||||||
|
BASIC_CFLAGS += -DNO_THREAD_SAFE_PREAD
|
||||||
endif
|
endif
|
||||||
ifdef NO_FAST_WORKING_DIRECTORY
|
ifdef NO_FAST_WORKING_DIRECTORY
|
||||||
BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
|
BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
|
||||||
|
@ -39,8 +39,8 @@ struct base_data {
|
|||||||
int ofs_first, ofs_last;
|
int ofs_first, ofs_last;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(NO_PTHREADS) && defined(NO_PREAD)
|
#if !defined(NO_PTHREADS) && defined(NO_THREAD_SAFE_PREAD)
|
||||||
/* NO_PREAD uses compat/pread.c, which is not thread-safe. Disable threading. */
|
/* pread() emulation is not thread-safe. Disable threading. */
|
||||||
#define NO_PTHREADS
|
#define NO_PTHREADS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user