rendercache/decodercache: moved qmutex that was only used by decodercache into

decodercache's derived class
This commit is contained in:
itsmattkc
2020-02-23 11:46:30 +11:00
parent 866db58965
commit 813c2e411a
2 changed files with 11 additions and 9 deletions
+11 -1
View File
@@ -5,6 +5,16 @@
#include "project/item/footage/stream.h"
#include "rendercache.h"
using DecoderCache = RenderCache<Stream*, DecoderPtr>;
class DecoderCache : public RenderCache<Stream*, DecoderPtr>
{
public:
DecoderCache() = default;
QMutex* lock() {return &lock_;}
private:
QMutex lock_;
};
#endif // DECODERCACHE_H
-8
View File
@@ -18,17 +18,9 @@ public:
bool Has(K key) const {return values_.contains(key);}
void Lock() { lock_.lock(); }
void Unlock() { lock_.unlock(); }
QMutex* lock() { return &lock_; }
private:
QHash<K, V> values_;
QMutex lock_;
};
#endif // RENDERCACHE_H