diff --git a/pxr/usd/usd/clipCache.cpp b/pxr/usd/usd/clipCache.cpp index c582e1d8be..b8215378ed 100644 --- a/pxr/usd/usd/clipCache.cpp +++ b/pxr/usd/usd/clipCache.cpp @@ -218,10 +218,9 @@ Usd_ClipCache::PopulateClipsForPrim( const bool primHasClips = !allClips.empty(); if (primHasClips) { TRACE_SCOPE("Usd_ClipCache::PopulateClipsForPrim (primHasClips)"); - tbb::mutex::scoped_lock lock; - if (_concurrentPopulationContext) { - lock.acquire(_concurrentPopulationContext->_mutex); - } + std::unique_lock lock = (_concurrentPopulationContext) ? + std::unique_lock(_concurrentPopulationContext->_mutex) : + std::unique_lock(); // Find nearest ancestor with clips specified. const std::vector* ancestralClips = nullptr; @@ -260,10 +259,10 @@ Usd_ClipCache::PopulateClipsForPrim( SdfLayerHandleSet Usd_ClipCache::GetUsedLayers() const { - tbb::mutex::scoped_lock lock; - if (_concurrentPopulationContext) { - lock.acquire(_concurrentPopulationContext->_mutex); - } + std::unique_lock lock = (_concurrentPopulationContext) ? + std::unique_lock(_concurrentPopulationContext->_mutex) : + std::unique_lock(); + SdfLayerHandleSet layers; for (_ClipTable::iterator::value_type const &clipsListIter : _table){ for (Usd_ClipSetRefPtr const &clipSet : clipsListIter.second){ @@ -342,10 +341,9 @@ const std::vector& Usd_ClipCache::GetClipsForPrim(const SdfPath& path) const { TRACE_FUNCTION(); - tbb::mutex::scoped_lock lock; - if (_concurrentPopulationContext) { - lock.acquire(_concurrentPopulationContext->_mutex); - } + std::unique_lock lock = (_concurrentPopulationContext) ? + std::unique_lock(_concurrentPopulationContext->_mutex) : + std::unique_lock(); return _GetClipsForPrim_NoLock(path); } diff --git a/pxr/usd/usd/clipCache.h b/pxr/usd/usd/clipCache.h index 2bff0833aa..fbe2ea72dc 100644 --- a/pxr/usd/usd/clipCache.h +++ b/pxr/usd/usd/clipCache.h @@ -30,7 +30,7 @@ #include "pxr/usd/usd/clipSet.h" #include "pxr/usd/sdf/pathTable.h" -#include +#include #include PXR_NAMESPACE_OPEN_SCOPE @@ -61,7 +61,7 @@ class Usd_ClipCache explicit ConcurrentPopulationContext(Usd_ClipCache &cache); ~ConcurrentPopulationContext(); Usd_ClipCache &_cache; - tbb::mutex _mutex; + std::mutex _mutex; }; /// Populate the cache with clips for \p prim. Returns true if clips diff --git a/pxr/usd/usd/instanceCache.h b/pxr/usd/usd/instanceCache.h index 0a25a7e30c..4b7c948de2 100644 --- a/pxr/usd/usd/instanceCache.h +++ b/pxr/usd/usd/instanceCache.h @@ -30,7 +30,7 @@ #include "pxr/usd/sdf/path.h" #include "pxr/base/tf/hashmap.h" -#include +#include #include #include #include