Fixed threading issue of checking if command buffer is empty
This commit is contained in:
parent
8b2c7b0bca
commit
b3b79006d7
@ -121,13 +121,14 @@ void IAP_Queue_Push(IAPCommandQueue* queue, IAPCommand* cmd)
|
||||
void IAP_Queue_Flush(IAPCommandQueue* queue, IAPCommandFn fn, void* ctx)
|
||||
{
|
||||
assert(fn != 0);
|
||||
|
||||
DM_MUTEX_SCOPED_LOCK(queue->m_Mutex);
|
||||
|
||||
if (queue->m_Commands.Empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DM_MUTEX_SCOPED_LOCK(queue->m_Mutex);
|
||||
|
||||
for(uint32_t i = 0; i != queue->m_Commands.Size(); ++i)
|
||||
{
|
||||
fn(&queue->m_Commands[i], ctx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user