mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 13:18:26 +02:00
use tbb::atomic for cp
This commit is contained in:
parent
ad7c01e86e
commit
5e9fb17949
2 changed files with 2 additions and 8 deletions
|
@ -430,8 +430,6 @@ void AudioMixerClientData::cleanupCodec() {
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioMixerClientData::IgnoreZone& AudioMixerClientData::IgnoreZoneMemo::get(unsigned int frame) {
|
AudioMixerClientData::IgnoreZone& AudioMixerClientData::IgnoreZoneMemo::get(unsigned int frame) {
|
||||||
assert(_frame.is_lock_free());
|
|
||||||
|
|
||||||
// check for a memoized zone
|
// check for a memoized zone
|
||||||
if (frame != _frame.load(std::memory_order_acquire)) {
|
if (frame != _frame.load(std::memory_order_acquire)) {
|
||||||
AvatarAudioStream* stream = _data.getAvatarAudioStream();
|
AvatarAudioStream* stream = _data.getAvatarAudioStream();
|
||||||
|
@ -480,7 +478,6 @@ void AudioMixerClientData::IgnoreNodeCache::cache(bool shouldIgnore) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioMixerClientData::IgnoreNodeCache::isCached() {
|
bool AudioMixerClientData::IgnoreNodeCache::isCached() {
|
||||||
assert(_isCached.is_lock_free());
|
|
||||||
return _isCached;
|
return _isCached;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,16 +130,13 @@ private:
|
||||||
|
|
||||||
class IgnoreNodeCache {
|
class IgnoreNodeCache {
|
||||||
public:
|
public:
|
||||||
// std::atomic is not copyable - always initialize uncached
|
|
||||||
IgnoreNodeCache() {}
|
|
||||||
IgnoreNodeCache(const IgnoreNodeCache& other) {}
|
|
||||||
|
|
||||||
void cache(bool shouldIgnore);
|
void cache(bool shouldIgnore);
|
||||||
bool isCached();
|
bool isCached();
|
||||||
bool shouldIgnore();
|
bool shouldIgnore();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::atomic<bool> _isCached { false };
|
// tbb::atomic supports copy-ctor
|
||||||
|
tbb::atomic<bool> _isCached { false };
|
||||||
bool _shouldIgnore { false };
|
bool _shouldIgnore { false };
|
||||||
};
|
};
|
||||||
struct IgnoreNodeCacheHasher { std::size_t operator()(const QUuid& key) const { return qHash(key); } };
|
struct IgnoreNodeCacheHasher { std::size_t operator()(const QUuid& key) const { return qHash(key); } };
|
||||||
|
|
Loading…
Reference in a new issue