701: Prevent internal thread from cleanup r=kvark a=kvark

**Connections**
Fixes #700

**Description**
The logic that removes command allocators for threads that no longer use it was accidentally removing the one for the "main" thread.

**Testing**
Untested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
bors[bot]
2020-06-05 02:47:41 +00:00
committed by GitHub

View File

@@ -205,11 +205,11 @@ impl<B: hal::Backend> CommandAllocator<B> {
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 {