MessageQueue write time to current message not the next

This commit is contained in:
Patrick Chin 2020-06-08 19:17:35 +01:00 committed by akallabeth
parent 733026dada
commit 8515846317

View File

@ -100,12 +100,13 @@ BOOL MessageQueue_Dispatch(wMessageQueue* queue, wMessage* message)
}
CopyMemory(&(queue->array[queue->tail]), message, sizeof(wMessage));
queue->tail = (queue->tail + 1) % queue->capacity;
queue->size++;
message = &(queue->array[queue->tail]);
message->time = GetTickCount64();
queue->tail = (queue->tail + 1) % queue->capacity;
queue->size++;
if (queue->size > 0)
SetEvent(queue->event);