Skip to content

Commit 7c5d094

Browse files
fixup! fix(core): drop PendingSubmission's guards in reverse acquisition order
1 parent 868404d commit 7c5d094

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

wgpu-core/src/device/queue.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,8 @@ impl WebGpuError for QueueSubmitError {
638638
/// [`submit`]: `PendingSubmission::submit`
639639
pub(crate) struct PendingSubmission<'a> {
640640
queue: &'a Queue,
641-
// Declared before `snatch_guard` so that it is dropped first. `snatch_guard`
642-
// is acquired by the caller and `command_index_guard` in
643-
// `Queue::allocate_submission`, so releasing in field order would release the
644-
// older guard first — which `--cfg wgpu_validate_locks` rejects.
641+
// NOTE: Guards must be declared in reverse of acquisition order, so `wgpu_validate_locks`
642+
// succeeds.
645643
command_index_guard: RwLockWriteGuard<'a, CommandIndices>,
646644
snatch_guard: SnatchGuard<'a>,
647645
// Command buffers to be executed, along with trackers for the resources they use.

0 commit comments

Comments
 (0)