Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
msgq: try again when no timeout on poll but also no message
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm committed Nov 18, 2019
1 parent c4f2ad5 commit 30aaadd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion messaging/impl_msgq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,14 @@ Message * MSGQSubSocket::receive(bool non_blocking){

int t = (timeout != -1) ? timeout : 100;

msgq_poll(items, 1, t);
int n = msgq_poll(items, 1, t);
rc = msgq_msg_recv(&msg, q);

// The poll indicated a message was ready, but the receive failed. Try again
if (n == 1 && rc == 0){
continue;
}

if (timeout != -1){
break;
}
Expand Down

0 comments on commit 30aaadd

Please sign in to comment.