path: root/builtin/index-pack.c
diff options
authorJunio C Hamano <>2012-06-26 18:19:32 (GMT)
committerJunio C Hamano <>2012-06-26 21:23:03 (GMT)
commitc0f86547c522906da7538c0d2b7b0de608499c23 (patch)
tree10f126f7f2ee2488b50783c397be3f689786b791 /builtin/index-pack.c
parent4c8a9db6f7dd9e10b5ce9bfbcd5faa82a8c86ce3 (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/index-pack.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index dc2cfe6..4705478 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -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. */