From b5c38ae40d7e9d3e05faef075f6ed173f55fe872 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 4 Jun 2020 22:45:59 -0400 Subject: [PATCH] Prevent internal thread from cleanup --- wgpu-core/src/command/allocator.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wgpu-core/src/command/allocator.rs b/wgpu-core/src/command/allocator.rs index 1a2ce77adb..21c71cd61b 100644 --- a/wgpu-core/src/command/allocator.rs +++ b/wgpu-core/src/command/allocator.rs @@ -205,11 +205,11 @@ impl CommandAllocator { pub fn maintain(&self, device: &B::Device, last_done_index: SubmissionIndex) { let mut inner = self.inner.lock(); let mut remove_threads = Vec::new(); - for (thread_id, pool) in inner.pools.iter_mut() { + for (&thread_id, pool) in inner.pools.iter_mut() { pool.maintain(last_done_index); - if pool.total == pool.available.len() { + if pool.total == pool.available.len() && thread_id != self.internal_thread_id { assert!(pool.pending.is_empty()); - remove_threads.push(*thread_id); + remove_threads.push(thread_id); } } for thread_id in remove_threads {