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.