diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-03-26 12:23:51 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-03-26 12:23:51 +0100 |
commit | 6e461de50e73c0c957af73e5ee7a25f4d0293490 (patch) | |
tree | 03916b36c1cf0e25239b8d6cc0cf013b0fcb3697 /src/audiocacheidmanager.cc | |
parent | 702e6907265035af031004f21ce09e3f62037fb4 (diff) |
Make all mutex locks const, as per linter warning
Diffstat (limited to 'src/audiocacheidmanager.cc')
-rw-r--r-- | src/audiocacheidmanager.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/audiocacheidmanager.cc b/src/audiocacheidmanager.cc index 91a1457..693ed3c 100644 --- a/src/audiocacheidmanager.cc +++ b/src/audiocacheidmanager.cc @@ -37,7 +37,7 @@ AudioCacheIDManager::~AudioCacheIDManager() void AudioCacheIDManager::init(unsigned int capacity) { - std::lock_guard<std::mutex> guard(mutex); + const std::lock_guard<std::mutex> guard(mutex); id2cache.resize(capacity); available_ids.resize(capacity); @@ -49,7 +49,7 @@ void AudioCacheIDManager::init(unsigned int capacity) cache_t& AudioCacheIDManager::getCache(cacheid_t id) { - std::lock_guard<std::mutex> guard(mutex); + const std::lock_guard<std::mutex> guard(mutex); assert(id != CACHE_NOID); assert(id != CACHE_DUMMYID); @@ -62,7 +62,7 @@ cache_t& AudioCacheIDManager::getCache(cacheid_t id) cacheid_t AudioCacheIDManager::registerID(const cache_t& cache) { - std::lock_guard<std::mutex> guard(mutex); + const std::lock_guard<std::mutex> guard(mutex); cacheid_t id = CACHE_NOID; @@ -86,7 +86,7 @@ cacheid_t AudioCacheIDManager::registerID(const cache_t& cache) void AudioCacheIDManager::releaseID(cacheid_t id) { - std::lock_guard<std::mutex> guard(mutex); + const std::lock_guard<std::mutex> guard(mutex); assert(id2cache[id].id != CACHE_NOID); // Test if it wasn't already released. @@ -97,7 +97,7 @@ void AudioCacheIDManager::releaseID(cacheid_t id) void AudioCacheIDManager::disableActive() { - // Run through all active cache_ts and disable them. + // Run through all active CacheBuffers and disable them. for(auto& cache : id2cache) { if(cache.id != CACHE_NOID) |