summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2010-03-06 16:40:42 +0100
committerJunio C Hamano <gitster@pobox.com>2010-03-07 00:37:36 -0800
commit200a76b74db5c2c75bcf73773cb85c5603ec038e (patch)
tree997a47438fe7e1ff3a9f649cc1f720c47dee4111 /Makefile
parent912b26324dbc1eb9500e49c90d271a330cbcb30b (diff)
downloadgit-200a76b74db5c2c75bcf73773cb85c5603ec038e.tar.gz
Reimplement async procedures using pthreads
On Windows, async procedures have always been run in threads, and the implementation used Windows specific APIs. Rewrite the code to use pthreads. A new configuration option is introduced so that the threaded implementation can also be used on POSIX systems. Since this option is intended only as playground on POSIX, but is mandatory on Windows, the option is not documented. One detail is that on POSIX it is necessary to set FD_CLOEXEC on the pipe handles. On Windows, this is not needed because pipe handles are not inherited to child processes, and the new calls to set_cloexec() are effectively no-ops. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 52f2cc040b..2fe52f8163 100644
--- a/Makefile
+++ b/Makefile
@@ -979,6 +979,7 @@ ifeq ($(uname_S),Windows)
NO_CURL = YesPlease
NO_PYTHON = YesPlease
BLK_SHA1 = YesPlease
+ ASYNC_AS_THREAD = YesPlease
CC = compat/vcbuild/scripts/clink.pl
AR = compat/vcbuild/scripts/lib.pl
@@ -1030,6 +1031,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_REGEX = YesPlease
NO_PYTHON = YesPlease
BLK_SHA1 = YesPlease
+ ASYNC_AS_THREAD = YesPlease
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch -Icompat/win32
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \
@@ -1342,6 +1344,9 @@ ifdef NO_PTHREADS
else
EXTLIBS += $(PTHREAD_LIBS)
LIB_OBJS += thread-utils.o
+ifdef ASYNC_AS_THREAD
+ BASIC_CFLAGS += -DASYNC_AS_THREAD
+endif
endif
ifdef DIR_HAS_BSD_GROUP_SEMANTICS