diff options
| author | Nicolas James <nj3ahxac@gmail.com> | 2026-04-06 12:18:10 +1000 |
|---|---|---|
| committer | Nicolas James <nj3ahxac@gmail.com> | 2026-04-06 12:18:10 +1000 |
| commit | a9a083ea5c649498d2f12e611dbc7c767d152130 (patch) | |
| tree | e67cfd11bc37a4faa0f1fbd448e66307cd75a624 /src/layer_context.hh | |
| parent | fcdac1c3287d314d7127516d56f0dec788392063 (diff) | |
Add WIP refactored reflex impl
Diffstat (limited to 'src/layer_context.hh')
| -rw-r--r-- | src/layer_context.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/layer_context.hh b/src/layer_context.hh index 5c16926..e7b24b3 100644 --- a/src/layer_context.hh +++ b/src/layer_context.hh @@ -1,7 +1,7 @@ #ifndef LAYER_CONTEXT_HH_ #define LAYER_CONTEXT_HH_ -#include <mutex> +#include <shared_mutex> #include <unordered_map> #include <vulkan/vulkan_core.h> @@ -63,7 +63,7 @@ class LayerContext final : public Context { static constexpr auto NVIDIA_DEVICE_NAME = "NVIDIA GeForce RTX 5090"; public: - std::mutex mutex; + std::shared_mutex mutex; std::unordered_map<void*, std::shared_ptr<Context>> contexts; bool should_expose_reflex = false; @@ -82,7 +82,7 @@ class LayerContext final : public Context { std::shared_ptr<dispatch_context_t<DT>> get_context(const DT& dt) { const auto key = get_key(dt); - const auto lock = std::scoped_lock{this->mutex}; + const auto lock = std::shared_lock{this->mutex}; const auto it = this->contexts.find(key); assert(it != std::end(this->contexts)); |
