diff --git a/dso/map/DeformationMap/DeformationMap.cc b/dso/map/DeformationMap/DeformationMap.cc index 61412d6..c4f881c 100644 --- a/dso/map/DeformationMap/DeformationMap.cc +++ b/dso/map/DeformationMap/DeformationMap.cc @@ -56,8 +56,8 @@ DeformationMap::DeformationMap(const scene_rdl2::rdl2::SceneClass& sceneClass, // To allow for the possibility that we may someday create image maps // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE diff --git a/dso/map/DirectionalMap/DirectionalMap.cc b/dso/map/DirectionalMap/DirectionalMap.cc index efcd5db..c98d386 100644 --- a/dso/map/DirectionalMap/DirectionalMap.cc +++ b/dso/map/DirectionalMap/DirectionalMap.cc @@ -57,8 +57,8 @@ DirectionalMap::DirectionalMap(const SceneClass& sceneClass, const std::string& // to allow for the possibility that we may someday create image maps // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE sDirectionalMapData.sErrorMissingRefN = mLogEventRegistry.createEvent(scene_rdl2::logging::ERROR_LEVEL, diff --git a/dso/map/GradientMap/GradientMap.cc b/dso/map/GradientMap/GradientMap.cc index 8937826..1b3fc43 100644 --- a/dso/map/GradientMap/GradientMap.cc +++ b/dso/map/GradientMap/GradientMap.cc @@ -114,8 +114,8 @@ GradientMap::GradientMap(const scene_rdl2::rdl2::SceneClass &sceneClass, // to allow for the possibility that we may someday create image maps // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE sStaticGradientMapData.sErrorMissingReferenceData = mLogEventRegistry.createEvent(scene_rdl2::logging::ERROR_LEVEL, diff --git a/dso/map/HairColumnMap/HairColumnMap.cc b/dso/map/HairColumnMap/HairColumnMap.cc index 71d0c9b..20cd52b 100644 --- a/dso/map/HairColumnMap/HairColumnMap.cc +++ b/dso/map/HairColumnMap/HairColumnMap.cc @@ -49,8 +49,8 @@ HairColumnMap::HairColumnMap(const SceneClass &sceneClass, const std::string &na // to allow for the possibility that we may someday create image maps // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE sErrorScatterTagMissing = mLogEventRegistry.createEvent(scene_rdl2::logging::ERROR_LEVEL, diff --git a/dso/map/NoiseMap/v2/NoiseMap_v2.cc b/dso/map/NoiseMap/v2/NoiseMap_v2.cc index 92f615d..5c204cd 100644 --- a/dso/map/NoiseMap/v2/NoiseMap_v2.cc +++ b/dso/map/NoiseMap/v2/NoiseMap_v2.cc @@ -67,8 +67,8 @@ NoiseMap_v2::NoiseMap_v2(SceneClass const &sceneClass, // to allow for the possibility that we may someday create image maps // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE sStaticNoiseMapData.sErrorMissingReferenceData = mLogEventRegistry.createEvent(scene_rdl2::logging::ERROR_LEVEL, diff --git a/dso/map/NoiseWorleyMap/v2/NoiseWorleyMap_v2.cc b/dso/map/NoiseWorleyMap/v2/NoiseWorleyMap_v2.cc index cc41dd6..3af426e 100644 --- a/dso/map/NoiseWorleyMap/v2/NoiseWorleyMap_v2.cc +++ b/dso/map/NoiseWorleyMap/v2/NoiseWorleyMap_v2.cc @@ -68,8 +68,8 @@ NoiseWorleyMap_v2::NoiseWorleyMap_v2(SceneClass const &sceneClass, std::string c // to allow for the possibility that we may someday create image maps // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE sStaticNoiseWorleyMapData.sErrorMissingReferenceData = mLogEventRegistry.createEvent(scene_rdl2::logging::ERROR_LEVEL, diff --git a/dso/map/UVTransformMap/UVTransformMap.cc b/dso/map/UVTransformMap/UVTransformMap.cc index 6aa9ac6..2e34c46 100644 --- a/dso/map/UVTransformMap/UVTransformMap.cc +++ b/dso/map/UVTransformMap/UVTransformMap.cc @@ -96,8 +96,8 @@ UVTransformMap::UVTransformMap(const SceneClass& sceneClass, // to allow for the possibility that we may someday create image maps // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE sStaticUVTransformMapData.sErrorMissingReferenceData = mLogEventRegistry.createEvent(scene_rdl2::logging::ERROR_LEVEL, diff --git a/dso/material/HairLayer/HairLayerMaterial.cc b/dso/material/HairLayer/HairLayerMaterial.cc index a46d5b5..d397c14 100644 --- a/dso/material/HairLayer/HairLayerMaterial.cc +++ b/dso/material/HairLayer/HairLayerMaterial.cc @@ -140,8 +140,8 @@ HairLayerMaterial::HairLayerMaterial(const scene_rdl2::rdl2::SceneClass& sceneCl // with a mutex. mIspc.mStaticData = (ispc::HairLayerMaterialStaticData*)&sStaticHairLayerMaterialData; - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE mIspc.mStaticData->sErrorMismatchedFresnelType = diff --git a/lib/common/noise/Noise.cc b/lib/common/noise/Noise.cc index cf814dd..be6b5ca 100644 --- a/lib/common/noise/Noise.cc +++ b/lib/common/noise/Noise.cc @@ -13,7 +13,7 @@ using namespace scene_rdl2::math; bool Noise::sNoiseIsDataInitialized = false; scene_rdl2::util::Random Noise::sNoiseRandom = scene_rdl2::util::Random(0xbeadceef); -tbb::mutex Noise::sNoiseInitDataMutex; +std::mutex Noise::sNoiseInitDataMutex; std::vector Noise::sNoisePermutationTable; Noise::Noise(const int seed, @@ -25,7 +25,7 @@ Noise::Noise(const int seed, mIspc.mTableSize = tableSize; if (useStaticTables) { - tbb::mutex::scoped_lock dataLock(sNoiseInitDataMutex); // Lock this part that initializes static data + std::scoped_lock dataLock(sNoiseInitDataMutex); // Lock this part that initializes static data // Only construct the static data once to share across all instances if (!sNoiseIsDataInitialized) { buildStaticTables(tableSize); diff --git a/lib/common/noise/Noise.h b/lib/common/noise/Noise.h index 422d438..b0f0641 100644 --- a/lib/common/noise/Noise.h +++ b/lib/common/noise/Noise.h @@ -8,9 +8,9 @@ #pragma warning disable 1711 // Warnings about assignemnt to statically allocated data #include "Noise_ispc_stubs.h" -#include #include #include +#include // Forward declaration namespace scene_rdl2 { @@ -71,7 +71,7 @@ class Noise // Static data static bool sNoiseIsDataInitialized; static scene_rdl2::util::Random sNoiseRandom; - static tbb::mutex sNoiseInitDataMutex; + static std::mutex sNoiseInitDataMutex; static std::vector sNoisePermutationTable; private: diff --git a/lib/common/noise/Worley.cc b/lib/common/noise/Worley.cc index 248667a..b19469b 100644 --- a/lib/common/noise/Worley.cc +++ b/lib/common/noise/Worley.cc @@ -227,7 +227,7 @@ collectPoints(const Worley_PointArray::iterator tmpWorleyPointsBeg, // Static data bool Worley::sIsWorleyDataInitialized = false; -tbb::mutex Worley::sWorleyInitDataMutex; +std::mutex Worley::sWorleyInitDataMutex; std::vector Worley::sWorleyPointsX; std::vector Worley::sWorleyPointsY; std::vector Worley::sWorleyPointsZ; @@ -255,7 +255,7 @@ Worley::Worley(const int seed, initPointProbabilities(); if (useStaticTables) { - tbb::mutex::scoped_lock dataLock(sWorleyInitDataMutex); // Lock this part that initializes static data + std::scoped_lock dataLock(sWorleyInitDataMutex); // Lock this part that initializes static data // Only construct the static data once to share across all instances if (!sIsWorleyDataInitialized) { buildStaticPointTables(addNormals, tableSize); diff --git a/lib/common/noise/Worley.h b/lib/common/noise/Worley.h index 59997bc..20f5824 100644 --- a/lib/common/noise/Worley.h +++ b/lib/common/noise/Worley.h @@ -184,7 +184,7 @@ class Worley : public Noise // Static data static bool sIsWorleyDataInitialized; - static tbb::mutex sWorleyInitDataMutex; + static std::mutex sWorleyInitDataMutex; static std::vector sWorleyPointsX; static std::vector sWorleyPointsY; diff --git a/lib/map/projection/ProjectionUtil.cc b/lib/map/projection/ProjectionUtil.cc index bc0b252..a31c552 100644 --- a/lib/map/projection/ProjectionUtil.cc +++ b/lib/map/projection/ProjectionUtil.cc @@ -24,8 +24,8 @@ initLogEvents(ispc::PROJECTION_StaticData& staticData, // to allow for the possibility that we may someday create image maps // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE staticData.sErrorMissingProjector = logEventRegistry.createEvent(scene_rdl2::logging::ERROR_LEVEL, diff --git a/lib/material/dwabase/DwaBaseLayerable.cc b/lib/material/dwabase/DwaBaseLayerable.cc index 51ca1ed..4a878a1 100644 --- a/lib/material/dwabase/DwaBaseLayerable.cc +++ b/lib/material/dwabase/DwaBaseLayerable.cc @@ -53,8 +53,8 @@ DwaBaseLayerable::registerShadeTimeEventMessages() // To allow for the possibility that we may someday create materials // on multiple threads, we'll protect the writes of the class statics // with a mutex. - static tbb::mutex errorMutex; - tbb::mutex::scoped_lock lock(errorMutex); + static std::mutex errorMutex; + std::scoped_lock lock(errorMutex); MOONRAY_START_THREADSAFE_STATIC_WRITE sEventMessages.sErrorNoRefN =