From 3f6f1d766cc4ee5d756f5ef0cecd9bbd0eab8fa2 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Wed, 1 May 2024 16:25:57 -0700 Subject: [PATCH] [core] Add `#[track_caller]` to `Registry` lock methods. --- wgpu-core/src/registry.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wgpu-core/src/registry.rs b/wgpu-core/src/registry.rs index 3abd4b6eb9..84f073d086 100644 --- a/wgpu-core/src/registry.rs +++ b/wgpu-core/src/registry.rs @@ -101,9 +101,11 @@ impl Registry { pub(crate) fn get(&self, id: Id) -> Result, InvalidId> { self.read().get_owned(id) } + #[track_caller] pub(crate) fn read<'a>(&'a self) -> RwLockReadGuard<'a, Storage> { self.storage.read() } + #[track_caller] pub(crate) fn write<'a>(&'a self) -> RwLockWriteGuard<'a, Storage> { self.storage.write() }