WorkerThreadPool: Refactor deadlock prevention collaboration into a generic mechanism
This is strictly beyond a refactor because it also changes when the mutexes are relocked, but that's only for extra safety.
This commit is contained in:
@ -364,7 +364,7 @@ class CommandQueueMT {
|
||||
|
||||
lock();
|
||||
|
||||
WorkerThreadPool::thread_enter_command_queue_mt_flush(this);
|
||||
uint32_t allowance_id = WorkerThreadPool::thread_enter_unlock_allowance_zone(&mutex);
|
||||
while (flush_read_ptr < command_mem.size()) {
|
||||
uint64_t size = *(uint64_t *)&command_mem[flush_read_ptr];
|
||||
flush_read_ptr += 8;
|
||||
@ -383,7 +383,7 @@ class CommandQueueMT {
|
||||
|
||||
flush_read_ptr += size;
|
||||
}
|
||||
WorkerThreadPool::thread_exit_command_queue_mt_flush();
|
||||
WorkerThreadPool::thread_exit_unlock_allowance_zone(allowance_id);
|
||||
|
||||
command_mem.clear();
|
||||
flush_read_ptr = 0;
|
||||
|
||||
Reference in New Issue
Block a user