index-pack: disable threading if NO_PREAD is defined
[gitweb.git] / builtin / index-pack.c
index d4685c50d7b4a4fec0c210725689d4d72029bda5..807ee56f79865cb04376268b051dceda5133f329 100644 (file)
@@ -39,6 +39,11 @@ 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. */
+#define NO_PTHREADS
+#endif
+
 struct thread_local {
 #ifndef NO_PTHREADS
        pthread_t thread;