gfx-rs/wgpu

[core] Deadlock between `Device::temp_suspected` and `CommandBuffer::data`

Closed this issue · 0 comments

Two threads can deadlock as follows:

  • The first thread calls Global::command_encoder_drop, which locks CommandBuffer::data while calling Device::untrack, which then locks Device::temp_suspected.
  • The second thread calls Queue::submit, which locks Device::temp_suspected and then CommandBuffer::data.

The lock around temp_suspected should never need to be held for a long time. This is just a simple allocation reuse.