Skip to content

Commit

Permalink
Merge pull request #1367 from daleglass/fix-recursive-mutex-warnings
Browse files Browse the repository at this point in the history
Replace the deprecated QMutex{ QMutex::Recursive} with QRecursiveMutex (solves approximately 1700 warnings).
  • Loading branch information
digisomni committed Oct 1, 2021
2 parents eab8dcd + b8d1057 commit 939d095
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions interface/src/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ private slots:

EntityTreePointer _entityClipboard;

mutable QMutex _viewMutex { QMutex::Recursive };
mutable QRecursiveMutex _viewMutex;
ViewFrustum _viewFrustum; // current state of view frustum, perspective, orientation, etc.
ViewFrustum _displayViewFrustum;

Expand Down Expand Up @@ -774,7 +774,7 @@ private slots:
bool _isMissingSequenceNumbers { false };

void checkChangeCursor();
mutable QMutex _changeCursorLock { QMutex::Recursive };
mutable QRecursiveMutex _changeCursorLock;
Qt::CursorShape _desiredCursor{ Qt::BlankCursor };
bool _cursorNeedsChanging { false };

Expand Down
2 changes: 1 addition & 1 deletion interface/src/graphics/GraphicsEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class GraphicsEngine {

protected:

mutable QMutex _renderArgsMutex{ QMutex::Recursive };
mutable QRecursiveMutex _renderArgsMutex;
AppRenderArgs _appRenderArgs;

RateCounter<500> _renderLoopCounter;
Expand Down
2 changes: 1 addition & 1 deletion interface/src/ui/overlays/Overlays.h
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ public slots:
private:
void cleanupOverlaysToDelete();

mutable QMutex _mutex { QMutex::Recursive };
mutable QRecursiveMutex _mutex;
QMap<QUuid, Overlay::Pointer> _overlays;
QList<Overlay::Pointer> _overlaysToDelete;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected slots:
// 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 };
Expand Down
4 changes: 2 additions & 2 deletions libraries/entities/src/EntitySimulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const int DIRTY_SIMULATION_FLAGS =

class EntitySimulation : public QObject, public std::enable_shared_from_this<EntitySimulation> {
public:
EntitySimulation() : _mutex(QMutex::Recursive), _nextExpiry(std::numeric_limits<uint64_t>::max()), _entityTree(nullptr) { }
EntitySimulation() : _mutex(), _nextExpiry(std::numeric_limits<uint64_t>::max()), _entityTree(nullptr) { }
virtual ~EntitySimulation() { setEntityTree(nullptr); }

inline EntitySimulationPointer getThisPointer() const {
Expand Down Expand Up @@ -90,7 +90,7 @@ class EntitySimulation : public QObject, public std::enable_shared_from_this<Ent
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
Expand Down
2 changes: 1 addition & 1 deletion libraries/networking/src/HMACAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class HMACAuth {
HMACHash result();

private:
QMutex _lock { QMutex::Recursive };
QRecursiveMutex _lock;
struct hmac_ctx_st* _hmacContext;
AuthMethod _authMethod;
};
Expand Down
2 changes: 1 addition & 1 deletion libraries/octree/src/OctreeEditPacketSender.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public slots:
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<EditMessagePair> _preServerEdits; // these will get packed into other larger packets
std::list<std::unique_ptr<NLPacket>> _preServerSingleMessagePackets; // these will go out as is

Expand Down
2 changes: 1 addition & 1 deletion libraries/physics/src/PhysicalEntitySimulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class PhysicalEntitySimulation : public EntitySimulation {

QList<EntityDynamicPointer> _dynamicsToAdd;
QSet<QUuid> _dynamicsToRemove;
QMutex _dynamicsMutex { QMutex::Recursive };
QRecursiveMutex _dynamicsMutex;

workload::SpacePointer _space;
uint64_t _nextBidExpiry;
Expand Down
2 changes: 1 addition & 1 deletion libraries/render-utils/src/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public slots:
QVector<float> _blendedBlendshapeCoefficients;
int _blendNumber { 0 };

mutable QMutex _mutex{ QMutex::Recursive };
mutable QRecursiveMutex _mutex;

bool _overrideModelTransform { false };
bool _triangleSetsValid { false };
Expand Down
2 changes: 1 addition & 1 deletion libraries/shared/src/DependencyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DependencyManager {
QHash<size_t, QSharedPointer<Dependency>> _instanceHash;
QHash<size_t, size_t> _inheritanceHash;

mutable QMutex _instanceHashMutex { QMutex::Recursive };
mutable QRecursiveMutex _instanceHashMutex;
mutable QMutex _inheritanceHashMutex;

bool _exiting { false };
Expand Down

0 comments on commit 939d095

Please sign in to comment.