mirror of
https://github.com/nihui/opencv-mobile.git
synced 2025-10-01 23:02:17 +08:00
37 lines
1.5 KiB
Diff
37 lines
1.5 KiB
Diff
diff -Nuarp opencv-4.12.0.orig/modules/core/src/mathfuncs.cpp opencv-4.12.0/modules/core/src/mathfuncs.cpp
|
|
--- opencv-4.12.0.orig/modules/core/src/mathfuncs.cpp 2025-07-13 20:34:53.536599577 +0800
|
|
+++ opencv-4.12.0/modules/core/src/mathfuncs.cpp 2025-07-13 20:49:01.526535532 +0800
|
|
@@ -1929,8 +1929,13 @@ const double* getExpTab64f()
|
|
const float* getExpTab32f()
|
|
{
|
|
static float CV_DECL_ALIGNED(64) expTab_f[EXPTAB_MASK+1];
|
|
+#ifndef OPENCV_DISABLE_THREAD_SUPPORT
|
|
static std::atomic<bool> expTab_f_initialized(false);
|
|
if (!expTab_f_initialized.load())
|
|
+#else
|
|
+ static bool expTab_f_initialized = false;
|
|
+ if (!expTab_f_initialized)
|
|
+#endif
|
|
{
|
|
for( int j = 0; j <= EXPTAB_MASK; j++ )
|
|
expTab_f[j] = (float)expTab[j];
|
|
diff -Nuarp opencv-4.12.0.orig/modules/core/src/parallel.cpp opencv-4.12.0/modules/core/src/parallel.cpp
|
|
--- opencv-4.12.0.orig/modules/core/src/parallel.cpp 2025-07-13 20:34:53.534609328 +0800
|
|
+++ opencv-4.12.0/modules/core/src/parallel.cpp 2025-07-13 20:49:01.526709430 +0800
|
|
@@ -517,6 +517,7 @@ void parallel_for_(const cv::Range& rang
|
|
if (range.empty())
|
|
return;
|
|
|
|
+#ifndef OPENCV_DISABLE_THREAD_SUPPORT
|
|
static std::atomic<bool> flagNestedParallelFor(false);
|
|
bool isNotNestedRegion = !flagNestedParallelFor.load();
|
|
if (isNotNestedRegion)
|
|
@@ -535,6 +536,7 @@ void parallel_for_(const cv::Range& rang
|
|
}
|
|
}
|
|
else // nested parallel_for_() calls are not parallelized
|
|
+#endif
|
|
{
|
|
CV_UNUSED(nstripes);
|
|
body(range);
|