Skip to content

Commit 0a7dd27

Browse files
authored
Merge pull request #63 from dzenanz/master
ENH: switch from ITK's mutex wrapper to std::mutex
2 parents 4ecbdbd + 85147a9 commit 0a7dd27

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

src/PerformanceBenchmarkingInformation.cxx.in

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
#include "PerformanceBenchmarkingUtilities.h"
2222
#include "PerformanceBenchmarkingInformation.h"
2323

24-
25-
#include "itkSimpleFastMutexLock.h"
26-
#include "itkMutexLockHolder.h"
2724
#include "itkObjectFactory.h"
2825

2926
#include <ostream>
@@ -44,7 +41,7 @@ m_Map.emplace(
4441

4542
namespace itk {
4643

47-
SimpleFastMutexLock PerformanceBenchmarkingInformation::m_Mutex;
44+
std::mutex PerformanceBenchmarkingInformation::m_Mutex;
4845
PerformanceBenchmarkingInformation::Pointer PerformanceBenchmarkingInformation::m_InformationInstance;
4946
PerformanceBenchmarkingInformation::MapType PerformanceBenchmarkingInformation::m_Map;
5047

@@ -59,7 +56,7 @@ PerformanceBenchmarkingInformation::Pointer
5956
PerformanceBenchmarkingInformation
6057
::GetInstance()
6158
{
62-
MutexLockHolder<SimpleFastMutexLock> mutexHolder(m_Mutex);
59+
std::lock_guard<std::mutex> mutexHolder(m_Mutex);
6360
if (m_InformationInstance.IsNull())
6461
{
6562
m_InformationInstance = ObjectFactory<Self>::Create();
@@ -117,11 +114,10 @@ PerformanceBenchmarkingInformation::GetAllKeys()
117114
PerformanceBenchmarkingInformation
118115
::PerformanceBenchmarkingInformation()
119116
{
120-
MutexLockHolder<SimpleFastMutexLock> mutexHolder(m_Mutex);
121117
m_InformationInstance = this; //threads need this
122118
m_InformationInstance->UnRegister(); // Remove extra reference
123119

124120
@MAPPING_VALUES@
125121
}
126122

127-
} //end namespace itk
123+
} //end namespace itk

src/PerformanceBenchmarkingInformation.h.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "itkMacro.h"
2222
#include "itkObject.h"
23-
#include "itkSimpleFastMutexLock.h"
23+
#include <mutex>
2424

2525
// A configure time introspection for
2626
#cmakedefine ITK_HAS_INFORMATION_H
@@ -100,9 +100,9 @@ private:
100100
PerformanceBenchmarkingInformation();
101101

102102
/** To lock on the internal variables */
103-
static SimpleFastMutexLock m_Mutex;
104-
static Pointer m_InformationInstance;
105-
static MapType m_Map;
103+
static std::mutex m_Mutex;
104+
static Pointer m_InformationInstance;
105+
static MapType m_Map;
106106
}; // end of class
107107

108108
} // end namespace itk

test/Docker/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ RUN mkdir -p /ITKPerformanceBenchmarking-build && \
2828
mkdir -p /ITKBenchmarks-build
2929
WORKDIR /
3030

31-
# ITK master 2018-02-22
32-
ENV ITK_GIT_TAG 4b1e6c03f1f9f07f2d97521103d5f438eef95d52
31+
# ITK master 2018-10-23
32+
ENV ITK_GIT_TAG 82ab8bde7679ca21559933356f193a78a1d47848
3333
RUN git clone https://github.com/InsightSoftwareConsortium/ITK.git && \
3434
cd ITK && \
3535
git checkout ${ITK_GIT_TAG} && \
@@ -46,6 +46,7 @@ RUN git clone https://github.com/InsightSoftwareConsortium/ITK.git && \
4646
-DITK_LEGACY_REMOVE:BOOL=ON \
4747
-DITK_BUILD_DEFAULT_MODULES:BOOL=OFF \
4848
-DITK_USE_SYSTEM_LIBRARIES:BOOL=ON \
49+
-DITK_USE_SYSTEM_HDF5:BOOL=OFF \
4950
-DModule_ITKTestKernel:BOOL=ON \
5051
-DModule_ITKIOImageBase:BOOL=ON \
5152
-DModule_ITKIOMeta:BOOL=ON \
@@ -62,7 +63,7 @@ RUN git clone https://github.com/InsightSoftwareConsortium/ITK.git && \
6263
-DModule_ITKRegionGrowing:BOOL=ON \
6364
-DModule_ITKWatersheds:BOOL=ON \
6465
-DModule_ITKConnectedComponents:BOOL=ON \
65-
-DModule_ITKAnisotropicDiffusion:BOOL=ON \
66+
-DModule_ITKAnisotropicSmoothing:BOOL=ON \
6667
-DModule_ITKFastMarching:BOOL=ON \
6768
-DModule_ITKLevelSets:BOOL=ON \
6869
../ITK && \

0 commit comments

Comments
 (0)