mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 10:37:56 +02:00
Fixing indentation and usage
This commit is contained in:
parent
72957670ba
commit
bf607e4c9c
2 changed files with 13 additions and 13 deletions
|
@ -135,7 +135,7 @@ void AvatarMixer::broadcastAvatarData() {
|
||||||
[&](const SharedNodePointer& node) {
|
[&](const SharedNodePointer& node) {
|
||||||
AvatarMixerClientData* nodeData = reinterpret_cast<AvatarMixerClientData*>(node->getLinkedData());
|
AvatarMixerClientData* nodeData = reinterpret_cast<AvatarMixerClientData*>(node->getLinkedData());
|
||||||
MutexTryLocker lock(nodeData->getMutex());
|
MutexTryLocker lock(nodeData->getMutex());
|
||||||
if (!lock.tryLock()) {
|
if (!lock.isLocked()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
++_sumListeners;
|
++_sumListeners;
|
||||||
|
@ -149,7 +149,7 @@ void AvatarMixer::broadcastAvatarData() {
|
||||||
// about a given otherNode to this node
|
// about a given otherNode to this node
|
||||||
// FIXME does this mean we should sort the othernodes by distance before iterating
|
// FIXME does this mean we should sort the othernodes by distance before iterating
|
||||||
// over them?
|
// over them?
|
||||||
float outputBandwidth = node->getBandwidthRecorder().getTotalAverageOutputKilobitsPerSecond();
|
float outputBandwidth = node->getOutboundBandwidth();
|
||||||
|
|
||||||
// this is an AGENT we have received head data from
|
// this is an AGENT we have received head data from
|
||||||
// send back a packet with other active node data to this node
|
// send back a packet with other active node data to this node
|
||||||
|
@ -164,14 +164,14 @@ void AvatarMixer::broadcastAvatarData() {
|
||||||
|
|
||||||
// Check throttling value
|
// Check throttling value
|
||||||
if (!(_performanceThrottlingRatio == 0 || randFloat() < (1.0f - _performanceThrottlingRatio))) {
|
if (!(_performanceThrottlingRatio == 0 || randFloat() < (1.0f - _performanceThrottlingRatio))) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
[&](const SharedNodePointer& otherNode) {
|
[&](const SharedNodePointer& otherNode) {
|
||||||
AvatarMixerClientData* otherNodeData = otherNodeData = reinterpret_cast<AvatarMixerClientData*>(otherNode->getLinkedData());
|
AvatarMixerClientData* otherNodeData = otherNodeData = reinterpret_cast<AvatarMixerClientData*>(otherNode->getLinkedData());
|
||||||
MutexTryLocker lock(otherNodeData->getMutex());
|
MutexTryLocker lock(otherNodeData->getMutex());
|
||||||
if (!lock.tryLock()) {
|
if (!lock.isLocked()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AvatarData& otherAvatar = otherNodeData->getAvatar();
|
AvatarData& otherAvatar = otherNodeData->getAvatar();
|
||||||
|
|
|
@ -15,14 +15,14 @@
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
|
||||||
class MutexTryLocker {
|
class MutexTryLocker {
|
||||||
QMutex & _mutex;
|
QMutex & _mutex;
|
||||||
bool _locked{false};
|
bool _locked{ false };
|
||||||
public:
|
public:
|
||||||
MutexTryLocker(QMutex &m) : _mutex(m), _locked(m.tryLock()) {}
|
MutexTryLocker(QMutex &m) : _mutex(m), _locked(m.tryLock()) {}
|
||||||
~MutexTryLocker() { if (_locked) _mutex.unlock(); }
|
~MutexTryLocker() { if (_locked) _mutex.unlock(); }
|
||||||
bool isLocked() {
|
bool isLocked() {
|
||||||
return _locked;
|
return _locked;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
#endif // hifi_UUID_h
|
#endif // hifi_TryLocker_h
|
||||||
|
|
Loading…
Reference in a new issue