diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2021-01-18 14:01:38 +0100 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2021-01-19 11:53:10 +0100 |
commit | 8ed259b792f3a94939422384c829a6c6973afec8 (patch) | |
tree | 6ff66f499aeda5d36ba6d32eb4bafbcbe4e25b72 /core/io/resource.h | |
parent | 869f5b53288ec713553e024f91ec88b47ce960d9 (diff) | |
download | redot-engine-8ed259b792f3a94939422384c829a6c6973afec8.tar.gz |
Modernize RWLock
- Based on C++14's `shared_time_mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
Diffstat (limited to 'core/io/resource.h')
-rw-r--r-- | core/io/resource.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/io/resource.h b/core/io/resource.h index eda18a8538..d0cd6ea3ac 100644 --- a/core/io/resource.h +++ b/core/io/resource.h @@ -149,16 +149,15 @@ typedef Ref<Resource> RES; class ResourceCache { friend class Resource; friend class ResourceLoader; //need the lock - static RWLock *lock; + static RWLock lock; static HashMap<String, Resource *> resources; #ifdef TOOLS_ENABLED static HashMap<String, HashMap<String, int>> resource_path_cache; // each tscn has a set of resource paths and IDs - static RWLock *path_cache_lock; + static RWLock path_cache_lock; #endif // TOOLS_ENABLED friend void unregister_core_types(); static void clear(); friend void register_core_types(); - static void setup(); public: static void reload_externals(); |