This commit is contained in:
Sebastian Messmer 2015-04-27 10:47:33 +02:00
parent 6f1c39fd21
commit bc33f69877
2 changed files with 2 additions and 3 deletions

View File

@ -48,7 +48,7 @@ void Cache::push(unique_ptr<Block> block) {
void Cache::_popOldEntries() {
lock_guard<mutex> lock(_mutex);
while(_cachedBlocks.size() > 0 && _cachedBlocks.peek()->ageSeconds() > PURGE_LIFETIME_SEC) {
_cachedBlocks.pop();
_cachedBlocks.pop();
}
}

View File

@ -11,8 +11,7 @@
namespace blockstore {
namespace caching {
//TODO Test
//TODO Move to utils
// A class that is a queue and a map at the same time. We could also see it as an addressable queue.
template<class Key, class Value>
class QueueMap {
public: