diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-29 20:49:18 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-29 20:49:18 +0100 |
commit | aa635eb8da9804488513d1f3d422e4810e611bb8 (patch) | |
tree | 35db06cfe32f360d974503ff8c7562d1ab75f322 /src/audiocacheidmanager.cc | |
parent | 67a23a559e9707f9caf46716df30a8bf71bba9a7 (diff) | |
parent | 9ebd9aa0c3429f896e6c41f279b570ba36aec674 (diff) |
Merge branch 'diskstreaming_review_chaot' into diskstreaming
Diffstat (limited to 'src/audiocacheidmanager.cc')
-rw-r--r-- | src/audiocacheidmanager.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/audiocacheidmanager.cc b/src/audiocacheidmanager.cc index a3e16a0..444ac38 100644 --- a/src/audiocacheidmanager.cc +++ b/src/audiocacheidmanager.cc @@ -31,7 +31,7 @@ AudioCacheIDManager::~AudioCacheIDManager() { - assert(availableids.size() == id2cache.size()); // All ids should be released. + assert(available_ids.size() == id2cache.size()); // All ids should be released. } void AudioCacheIDManager::init(unsigned int capacity) @@ -39,10 +39,10 @@ void AudioCacheIDManager::init(unsigned int capacity) std::lock_guard<std::mutex> guard(mutex); id2cache.resize(capacity); - availableids.resize(capacity); + available_ids.resize(capacity); for(size_t i = 0; i < capacity; ++i) { - availableids[i] = i; + available_ids[i] = i; } } @@ -65,14 +65,14 @@ cacheid_t AudioCacheIDManager::registerID(const cache_t& cache) cacheid_t id = CACHE_NOID; - if(availableids.empty()) + if(available_ids.empty()) { return CACHE_DUMMYID; } else { - id = availableids.back(); - availableids.pop_back(); + id = available_ids.back(); + available_ids.pop_back(); } assert(id2cache[id].id == CACHE_NOID); // Make sure it is not already in use @@ -91,7 +91,7 @@ void AudioCacheIDManager::releaseID(cacheid_t id) id2cache[id].id = CACHE_NOID; - availableids.push_back(id); + available_ids.push_back(id); } void AudioCacheIDManager::disableActive() |