3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 06:35:32 +02:00

use tbb::atomic for cp

This commit is contained in:
Zach Pomerantz 2017-02-07 18:50:23 +00:00
parent ad7c01e86e
commit 5e9fb17949
2 changed files with 2 additions and 8 deletions

View file

@ -430,8 +430,6 @@ void AudioMixerClientData::cleanupCodec() {
}
AudioMixerClientData::IgnoreZone& AudioMixerClientData::IgnoreZoneMemo::get(unsigned int frame) {
assert(_frame.is_lock_free());
// check for a memoized zone
if (frame != _frame.load(std::memory_order_acquire)) {
AvatarAudioStream* stream = _data.getAvatarAudioStream();
@ -480,7 +478,6 @@ void AudioMixerClientData::IgnoreNodeCache::cache(bool shouldIgnore) {
}
bool AudioMixerClientData::IgnoreNodeCache::isCached() {
assert(_isCached.is_lock_free());
return _isCached;
}

View file

@ -130,16 +130,13 @@ private:
class IgnoreNodeCache {
public:
// std::atomic is not copyable - always initialize uncached
IgnoreNodeCache() {}
IgnoreNodeCache(const IgnoreNodeCache& other) {}
void cache(bool shouldIgnore);
bool isCached();
bool shouldIgnore();
private:
std::atomic<bool> _isCached { false };
// tbb::atomic supports copy-ctor
tbb::atomic<bool> _isCached { false };
bool _shouldIgnore { false };
};
struct IgnoreNodeCacheHasher { std::size_t operator()(const QUuid& key) const { return qHash(key); } };