From b8d1057e1f38783cc8e0c6153458afe2ffc5393a Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sun, 26 Sep 2021 01:27:19 +0200 Subject: [PATCH] Replace the deprecated QMutex{ QMutex::Recursive} with QRecursiveMutex This fixes around 1700 warnings. --- interface/src/Application.h | 4 ++-- interface/src/graphics/GraphicsEngine.h | 2 +- interface/src/ui/overlays/Overlays.h | 2 +- .../display-plugins/src/display-plugins/CompositorHelper.h | 2 +- libraries/entities/src/EntitySimulation.h | 4 ++-- libraries/networking/src/HMACAuth.h | 2 +- libraries/octree/src/OctreeEditPacketSender.h | 2 +- libraries/physics/src/PhysicalEntitySimulation.h | 2 +- libraries/render-utils/src/Model.h | 2 +- libraries/shared/src/DependencyManager.h | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/interface/src/Application.h b/interface/src/Application.h index 165326215f..215473ddfb 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -648,7 +648,7 @@ private: EntityTreePointer _entityClipboard; - mutable QMutex _viewMutex { QMutex::Recursive }; + mutable QRecursiveMutex _viewMutex; ViewFrustum _viewFrustum; // current state of view frustum, perspective, orientation, etc. ViewFrustum _displayViewFrustum; @@ -774,7 +774,7 @@ private: bool _isMissingSequenceNumbers { false }; void checkChangeCursor(); - mutable QMutex _changeCursorLock { QMutex::Recursive }; + mutable QRecursiveMutex _changeCursorLock; Qt::CursorShape _desiredCursor{ Qt::BlankCursor }; bool _cursorNeedsChanging { false }; diff --git a/interface/src/graphics/GraphicsEngine.h b/interface/src/graphics/GraphicsEngine.h index dccb098d5e..a5e9286bc7 100644 --- a/interface/src/graphics/GraphicsEngine.h +++ b/interface/src/graphics/GraphicsEngine.h @@ -69,7 +69,7 @@ private: protected: - mutable QMutex _renderArgsMutex{ QMutex::Recursive }; + mutable QRecursiveMutex _renderArgsMutex; AppRenderArgs _appRenderArgs; RateCounter<500> _renderLoopCounter; diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h index b7e471bb1a..e59880c6d9 100644 --- a/interface/src/ui/overlays/Overlays.h +++ b/interface/src/ui/overlays/Overlays.h @@ -746,7 +746,7 @@ signals: private: void cleanupOverlaysToDelete(); - mutable QMutex _mutex { QMutex::Recursive }; + mutable QRecursiveMutex _mutex; QMap _overlays; QList _overlaysToDelete; diff --git a/libraries/display-plugins/src/display-plugins/CompositorHelper.h b/libraries/display-plugins/src/display-plugins/CompositorHelper.h index cc65eeeab7..389d49929e 100644 --- a/libraries/display-plugins/src/display-plugins/CompositorHelper.h +++ b/libraries/display-plugins/src/display-plugins/CompositorHelper.h @@ -161,7 +161,7 @@ private: // application specific position, when it's in desktop mode, the reticle position will simply move // the system mouse. glm::vec2 _reticlePositionInHMD { 0.0f, 0.0f }; - mutable QMutex _reticleLock { QMutex::Recursive }; + mutable QRecursiveMutex _reticleLock; QPointF _lastKnownRealMouse; bool _ignoreMouseMove { false }; diff --git a/libraries/entities/src/EntitySimulation.h b/libraries/entities/src/EntitySimulation.h index 5b7b38e447..5d5f4741d3 100644 --- a/libraries/entities/src/EntitySimulation.h +++ b/libraries/entities/src/EntitySimulation.h @@ -44,7 +44,7 @@ const int DIRTY_SIMULATION_FLAGS = class EntitySimulation : public QObject, public std::enable_shared_from_this { public: - EntitySimulation() : _mutex(QMutex::Recursive), _nextExpiry(std::numeric_limits::max()), _entityTree(nullptr) { } + EntitySimulation() : _mutex(), _nextExpiry(std::numeric_limits::max()), _entityTree(nullptr) { } virtual ~EntitySimulation() { setEntityTree(nullptr); } inline EntitySimulationPointer getThisPointer() const { @@ -90,7 +90,7 @@ protected: void callUpdateOnEntitiesThatNeedIt(uint64_t now); virtual void sortEntitiesThatMoved(); - QMutex _mutex{ QMutex::Recursive }; + QRecursiveMutex _mutex; SetOfEntities _entitiesToSort; // entities moved by simulation (and might need resort in EntityTree) SetOfEntities _simpleKinematicEntities; // entities undergoing non-colliding kinematic motion diff --git a/libraries/networking/src/HMACAuth.h b/libraries/networking/src/HMACAuth.h index 1346bdee17..92953af3a3 100644 --- a/libraries/networking/src/HMACAuth.h +++ b/libraries/networking/src/HMACAuth.h @@ -39,7 +39,7 @@ public: HMACHash result(); private: - QMutex _lock { QMutex::Recursive }; + QRecursiveMutex _lock; struct hmac_ctx_st* _hmacContext; AuthMethod _authMethod; }; diff --git a/libraries/octree/src/OctreeEditPacketSender.h b/libraries/octree/src/OctreeEditPacketSender.h index 318f6b81bb..ee1849ec31 100644 --- a/libraries/octree/src/OctreeEditPacketSender.h +++ b/libraries/octree/src/OctreeEditPacketSender.h @@ -93,7 +93,7 @@ protected: int _maxPendingMessages; bool _releaseQueuedMessagesPending; QMutex _pendingPacketsLock; - QMutex _packetsQueueLock{ QMutex::Recursive }; // don't let different threads release the queue while another thread is writing to it + QRecursiveMutex _packetsQueueLock; // don't let different threads release the queue while another thread is writing to it std::list _preServerEdits; // these will get packed into other larger packets std::list> _preServerSingleMessagePackets; // these will go out as is diff --git a/libraries/physics/src/PhysicalEntitySimulation.h b/libraries/physics/src/PhysicalEntitySimulation.h index 0f0a8e9295..1e8c65c639 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.h +++ b/libraries/physics/src/PhysicalEntitySimulation.h @@ -129,7 +129,7 @@ private: QList _dynamicsToAdd; QSet _dynamicsToRemove; - QMutex _dynamicsMutex { QMutex::Recursive }; + QRecursiveMutex _dynamicsMutex; workload::SpacePointer _space; uint64_t _nextBidExpiry; diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h index 930f942260..af477a2f09 100644 --- a/libraries/render-utils/src/Model.h +++ b/libraries/render-utils/src/Model.h @@ -444,7 +444,7 @@ protected: QVector _blendedBlendshapeCoefficients; int _blendNumber { 0 }; - mutable QMutex _mutex{ QMutex::Recursive }; + mutable QRecursiveMutex _mutex; bool _overrideModelTransform { false }; bool _triangleSetsValid { false }; diff --git a/libraries/shared/src/DependencyManager.h b/libraries/shared/src/DependencyManager.h index cd226b9960..eda8b60e9f 100644 --- a/libraries/shared/src/DependencyManager.h +++ b/libraries/shared/src/DependencyManager.h @@ -89,7 +89,7 @@ private: QHash> _instanceHash; QHash _inheritanceHash; - mutable QMutex _instanceHashMutex { QMutex::Recursive }; + mutable QRecursiveMutex _instanceHashMutex; mutable QMutex _inheritanceHashMutex; bool _exiting { false };