0001-Fixed-compilation-of-pthread-based-parallel_for-with-gcc-4.4.3.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Backport from https://github.com/Itseez/opencv/commit/1f983ec39c97298b0c8ce409a1cc229ecf14e55c
  2. From 1f983ec39c97298b0c8ce409a1cc229ecf14e55c Mon Sep 17 00:00:00 2001
  3. From: Maksim Shabunin <maksim.shabunin@itseez.com>
  4. Date: Tue, 9 Jun 2015 13:59:48 +0300
  5. Subject: [PATCH] Fixed compilation of pthread-based parallel_for with gcc
  6. 4.4.3
  7. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  8. ---
  9. modules/core/src/parallel.cpp | 12 +++++++-----
  10. 1 file changed, 7 insertions(+), 5 deletions(-)
  11. diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp
  12. index b1e7567..0b593ee 100644
  13. --- a/modules/core/src/parallel.cpp
  14. +++ b/modules/core/src/parallel.cpp
  15. @@ -132,8 +132,14 @@
  16. namespace cv
  17. {
  18. ParallelLoopBody::~ParallelLoopBody() {}
  19. +#if defined HAVE_PTHREADS && HAVE_PTHREADS
  20. + void parallel_for_pthreads(const cv::Range& range, const cv::ParallelLoopBody& body, double nstripes);
  21. + size_t parallel_pthreads_get_threads_num();
  22. + void parallel_pthreads_set_threads_num(int num);
  23. +#endif
  24. }
  25. +
  26. namespace
  27. {
  28. #ifdef CV_PARALLEL_FRAMEWORK
  29. @@ -301,7 +307,7 @@ void cv::parallel_for_(const cv::Range& range, const cv::ParallelLoopBody& body,
  30. }
  31. #elif defined HAVE_PTHREADS
  32. - void parallel_for_pthreads(const Range& range, const ParallelLoopBody& body, double nstripes);
  33. +
  34. parallel_for_pthreads(range, body, nstripes);
  35. #else
  36. @@ -361,8 +367,6 @@ int cv::getNumThreads(void)
  37. #elif defined HAVE_PTHREADS
  38. - size_t parallel_pthreads_get_threads_num();
  39. -
  40. return parallel_pthreads_get_threads_num();
  41. #else
  42. @@ -424,8 +428,6 @@ void cv::setNumThreads( int threads )
  43. #elif defined HAVE_PTHREADS
  44. - void parallel_pthreads_set_threads_num(int num);
  45. -
  46. parallel_pthreads_set_threads_num(threads);
  47. #endif
  48. --
  49. 2.4.4