From 84717b5b1b48ed769dee8c3eba0f0887596ec7e8 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 7 Oct 2023 01:36:25 +0200 Subject: [PATCH] ogr_proj_p.cpp: disable pthread_atfork() optimization on MacOS (fixes #8497) --- ogr/ogr_proj_p.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ogr/ogr_proj_p.cpp b/ogr/ogr_proj_p.cpp index 9acb5632c9e6..a27a84fe1975 100644 --- a/ogr/ogr_proj_p.cpp +++ b/ogr/ogr_proj_p.cpp @@ -35,6 +35,14 @@ #include "proj.h" +#if defined(__MACH__) && defined(__APPLE__) && defined(HAVE_PTHREAD_ATFORK) +// Works around a weird issue with GDAL, numpy and python threading on +// Mac. There is definitely something not understood, but as using pthread_atfork() +// is just an optimization, just disable it. +// Cf https://github.com/OSGeo/gdal/issues/8497 for details +#undef HAVE_PTHREAD_ATFORK +#endif + #ifndef _WIN32 #include #include