aboutsummaryrefslogtreecommitdiff
path: root/src/layer_context.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/layer_context.hh')
-rw-r--r--src/layer_context.hh6
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));