diff --git a/src/concurrent/msgq.c b/src/concurrent/msgq.c index 3f94e8d..766ff51 100644 --- a/src/concurrent/msgq.c +++ b/src/concurrent/msgq.c @@ -44,8 +44,13 @@ void* msgq_recv1(struct msgq* mq, int* out_type) if (mq->head == NULL) { return NULL; } else { + int type = mq->head->type; void* pl = mq->head->payload; mq->head = mq->head->next; + + if (out_type != NULL) { + *out_type = type; + } return pl; } }