|
Blender V4.3
|
#include <BLI_cache_mutex.hh>
Public Member Functions | |
| void | ensure (FunctionRef< void()> compute_cache) |
| void | tag_dirty () |
| bool | is_dirty () const |
| bool | is_cached () const |
Definition at line 68 of file BLI_cache_mutex.hh.
| void blender::CacheMutex::ensure | ( | FunctionRef< void()> | compute_cache | ) |
Make sure the cache exists and is up to date. This calls compute_cache once to update the cache (which is stored outside of this class) if it is dirty, otherwise it does nothing.
This function is thread-safe under the assumption that the same parameters are passed from every thread.
Definition at line 10 of file cache_mutex.cc.
References blender::threading::isolate_task(), and lock.
Referenced by blender::bke::node_tree_runtime::ensure_topology_cache().
|
inline |
Return true if the cache exists and is valid.
Definition at line 102 of file BLI_cache_mutex.hh.
Referenced by is_dirty().
|
inline |
Return true if the cache currently does not exist or has been invalidated.
Definition at line 94 of file BLI_cache_mutex.hh.
References is_cached().
|
inline |
Reset the cache. The next time ensure is called, it will recompute that code.
Definition at line 86 of file BLI_cache_mutex.hh.