Skip to content

Commit

Permalink
Introduce std::thread and std::mutex usage instead of pthread
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Feb 7, 2024
1 parent 5567e30 commit 46638f8
Show file tree
Hide file tree
Showing 241 changed files with 900 additions and 2,820 deletions.
22 changes: 21 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,27 @@
"stop_token": "cpp",
"view": "cpp",
"mixinvector": "cpp",
"charconv": "cpp"
"charconv": "cpp",
"coroutine": "cpp",
"resumable": "cpp",
"format": "cpp",
"ranges": "cpp",
"span": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
},
"C_Cpp.vcFormat.indent.namespaceContents": false,
"editor.formatOnSave": true,
Expand Down
Empty file modified 3rdparty/simdlib/Simd/SimdAlignment.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAllocator.hpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdArray.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx1.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx1Cpu.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx1Resizer.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2BgrToBgra.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2BgrToGray.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2BgrToRgb.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2BgraToBgr.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2BgraToGray.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2Cpu.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2Deinterleave.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2GaussianBlur.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2Reduce.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2ReduceGray2x2.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2ReduceGray3x3.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2ReduceGray4x4.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2ReduceGray5x5.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2ResizeBilinear.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdAvx2Resizer.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBase.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseBgrToBgra.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseBgrToGray.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseBgrToRgb.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseBgraToBgr.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseBgraToGray.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseCpu.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseDeinterleave.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseGaussianBlur.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdBaseResizer.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdConfig.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdConst.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdConversion.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdCopyPixel.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdCpu.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdDefs.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdEnable.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdExp.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdExtract.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdFrame.hpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdInit.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdLib.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdLib.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdLib.hpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdLoad.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdLoadBlock.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdLog.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdMath.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdMemory.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeon.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeonBgrToBgra.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeonBgrToGray.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeonBgrToRgb.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeonBgraToBgr.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeonBgraToGray.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeonDeinterleave.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeonGaussianBlur.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdNeonResizer.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdPixel.hpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdPow.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdResizer.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdResizerCommon.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdRuntime.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSet.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41BgrToBgra.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41BgrToGray.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41BgrToRgb.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41BgraToBgr.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41Cpu.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41GaussianBlur.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41GrayToBgr.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41Reduce.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41ReduceGray2x2.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41ReduceGray4x4.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41ResizeBilinear.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdSse41Resizer.cpp
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdStore.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdStream.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdUpdate.h
100755 → 100644
Empty file.
Empty file modified 3rdparty/simdlib/Simd/SimdView.hpp
100755 → 100644
Empty file.
17 changes: 3 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -586,17 +586,7 @@ if(SOQT_FOUND) # SoQt < 1.6.0 that depends on Qt4 was found. We need an explicit
VP_OPTION(USE_QT Qt "" "Include Coin/SoQt/Qt support" "" ON IF USE_SOQT AND NOT WINRT AND NOT IOS)
endif()
VP_OPTION(USE_SOXT SOXT "" "Include Coin/SoXt support" "" OFF IF USE_COIN3D AND NOT WINRT AND NOT IOS)
set(THREADS_PREFER_PTHREAD_FLAG ON)
VP_OPTION(USE_THREADS Threads "" "Include std::thread support" "" ON IF NOT (WIN32 OR MINGW))

# We need threads. To be changed to make threads optional
if(NOT USE_THREADS)
if(Threads_FOUND)
message(WARNING "We need std::thread. We turn USE_THREADS=ON.")
unset(USE_THREADS)
set(USE_THREADS ON CACHE BOOL "Include std::thread support" FORCE)
endif()
endif()
VP_OPTION(USE_THREADS Threads "" "Include std::thread support" "" ON)

VP_OPTION(USE_XML2 XML2 "" "Include libxml2 support" "" ON IF NOT WINRT)
if(CMAKE_TOOLCHAIN_FILE)
Expand All @@ -613,7 +603,7 @@ VP_OPTION(USE_X11 X11 "" "Include X11 support" "${X1
VP_OPTION(USE_GTK2 MyGTK2 "" "Include gtk2 support" "" OFF IF NOT WINRT AND NOT IOS)
VP_OPTION(USE_JPEG "JPEG;MyJPEG" "" "Include jpeg support" "" ON IF NOT IOS)
VP_OPTION(USE_PNG "PNG;MyPNG" "" "Include png support" "" ON IF NOT IOS)
# To control Pioneer mobile robots, under UNIX we need Aria, pthread, rt and dl 3rd party libraries
# To control Pioneer mobile robots, under UNIX we need Aria and std::threads, rt and dl 3rd party libraries
VP_OPTION(USE_ARIA ARIA "" "Include aria support" "" ON IF NOT WINRT AND NOT IOS)
#VP_OPTION(USE_RT RT "" "Include rt support" "" ON)
#VP_OPTION(USE_DL DL "" "Include dl support" "" ON)
Expand All @@ -624,7 +614,6 @@ VP_OPTION(USE_PCL PCL QUIET "Include Point Cloud Library suppor
VP_OPTION(USE_TENSORRT TensorRT "" "Include TensorRT support" "" ON IF NOT WINRT AND NOT IOS)
VP_OPTION(USE_NLOHMANN_JSON nlohmann_json QUIET "Include nlohmann json support" "" ON)

# Upgrade c++ standard to 14 for pcl 1.9.1.99 that enables by default c++ 14 standard
if(USE_PCL)
# PCL is used in modules gui, sensor and mbt.
# In these modules we cannot directly use PCL_INCLUDE_DIRS and PCL_LIBRARIES using:
Expand Down Expand Up @@ -705,7 +694,7 @@ endif()
# ----------------------------------------------------------------------------
# Build-in 3rd parties. Should be after c++ standard potential modification
# ----------------------------------------------------------------------------
VP_OPTION(WITH_PTHREAD "" "" "Build pthread as built-in library" "" ON IF (NOT USE_THREADS) AND (WIN32 OR MINGW) AND (NOT WINRT))
VP_OPTION(WITH_PTHREAD "" "" "Build pthread as built-in library" "" ON IF (WIN32 OR MINGW) AND (NOT WINRT))
# Since C99 is not supported by MSVC 2010 or prior, we disable apriltag if MSVC < 2012
VP_OPTION(WITH_APRILTAG "" "" "Build AprilTag as built-in library" "" ON IF (USE_THREADS OR WITH_PTHREAD) AND (NOT WINRT) AND (NOT MSVC_VERSION LESS 1700))
VP_OPTION(WITH_APRILTAG_BIG_FAMILY "" "" "Build AprilTag big family (41h12, 48h12, 49h12, 52h13)" "" OFF IF WITH_APRILTAG)
Expand Down
Empty file modified apps/calibration/hand_eye_calibration_show_extrinsics.py
100755 → 100644
Empty file.
Empty file modified cmake/templates/visp-config.bat.in
100755 → 100644
Empty file.
Empty file modified cmake/templates/visp-config.in
100755 → 100644
Empty file.
Empty file modified cmake/templates/visp-config.install.in
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion cmake/templates/vpConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
// Defined if XML2 library available.
#cmakedefine VISP_HAVE_XML2

// Defined if pthread library available.
// Defined if pthread library available (deprecated).
#cmakedefine VISP_HAVE_PTHREAD

// Defined if std::thread available.
Expand Down
Empty file modified doc/image/tutorial/started/img-monkey-win.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified doc/image/tutorial/visual-servo/img-bebop2-coord-system.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified example/calibration/camera_calibration_show_extrinsics.py
100755 → 100644
Empty file.
2 changes: 0 additions & 2 deletions example/device/framegrabber/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ set(example_cpp
grabDirectShow.cpp
grabDirectShowMulti.cpp
grabFlyCapture.cpp
grabRealSense.cpp
grabRealSense2.cpp
grabRealSense2_T265.cpp
grabV4l2MultiCpp11Thread.cpp
Expand Down Expand Up @@ -83,7 +82,6 @@ if(VISP_HAVE_REALSENSE OR VISP_HAVE_REALSENSE2)
list(APPEND CXX_FLAGS_MUTE_WARNINGS "-Wno-unqualified-std-cast-call")

visp_set_source_file_compile_flag(getRealSense2Info.cpp ${CXX_FLAGS_MUTE_WARNINGS})
visp_set_source_file_compile_flag(grabRealSense.cpp ${CXX_FLAGS_MUTE_WARNINGS})
visp_set_source_file_compile_flag(grabRealSense2.cpp ${CXX_FLAGS_MUTE_WARNINGS})
visp_set_source_file_compile_flag(grabRealSense2_T265.cpp ${CXX_FLAGS_MUTE_WARNINGS})
visp_set_source_file_compile_flag(readRealSenseData.cpp ${CXX_FLAGS_MUTE_WARNINGS})
Expand Down
259 changes: 0 additions & 259 deletions example/device/framegrabber/grabRealSense.cpp

This file was deleted.

Loading

0 comments on commit 46638f8

Please sign in to comment.