[util] fix msgq

This commit is contained in:
Milo Turner 2020-02-19 13:11:46 -05:00
parent 932e7fc708
commit 0a07bac2e7
1 changed files with 5 additions and 0 deletions

View File

@ -44,8 +44,13 @@ void* msgq_recv1(struct msgq* mq, int* out_type)
if (mq->head == NULL) { if (mq->head == NULL) {
return NULL; return NULL;
} else { } else {
int type = mq->head->type;
void* pl = mq->head->payload; void* pl = mq->head->payload;
mq->head = mq->head->next; mq->head = mq->head->next;
if (out_type != NULL) {
*out_type = type;
}
return pl; return pl;
} }
} }