Showing the changes to libraries/script-engine/src/ScriptCache.h (1 of 2 files). Show all
Unified · Split
| @@ -12,6 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | #ifndef hifi_ScriptCache_h |
| 13 | 13 | #define hifi_ScriptCache_h |
| 14 | 14 | |
| 15 | +#include <mutex> | |
| 15 | 16 | #include <ResourceCache.h> |
| 16 | 17 | |
| 17 | 18 | class ScriptUser { |
| @@ -27,6 +28,9 @@ class ScriptCache : public QObject, public Dependency { · 9 unmodified lines | ||
| 27 | 28 | Q_OBJECT |
| 28 | 29 | SINGLETON_DEPENDENCY |
| 29 | 30 | |
| 31 | + using Mutex = std::mutex; | |
| 32 | + using Lock = std::unique_lock<Mutex>; | |
| 33 | + | |
| 30 | 34 | public: |
| 31 | 35 | void clearCache(); |
| 32 | 36 | void getScriptContents(const QString& scriptOrURL, contentAvailableCallback contentAvailable, bool forceDownload = false); |
| @@ -46,6 +50,7 @@ private slots: · 13 unmodified lines | ||
| 46 | 50 | private: |
| 47 | 51 | ScriptCache(QObject* parent = NULL); |
| 48 | 52 | |
| 53 | + Mutex _containerLock; | |
| 49 | 54 | QMultiMap<QUrl, contentAvailableCallback> _contentCallbacks; |
| 50 | 55 | |
| 51 | 56 | QHash<QUrl, QString> _scriptCache; |