We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While doing upgrade from earlier WPC API library to c-mesh-api/master, we noticed this issue during code review.
In lib/platform/linux/platform.c, dispatch queue accesses indication queue with m_queue_mutex held. However, polling thread is accessing indication queue variables without taking mutex, for example at https://github.com/wirepas/c-mesh-api/blob/master/lib/platform/linux/platform.c#L177
The text was updated successfully, but these errors were encountered:
Sorry for late reply.
I don't think there is a real issue here. The only two parts where the queue is accessed is dispatch_indication for read access (https://github.com/wirepas/c-mesh-api/blob/master/lib/platform/linux/platform.c#L86) and onIndicationReceivedLocked for write access (https://github.com/wirepas/c-mesh-api/blob/master/lib/platform/linux/platform.c#L125)
But I agree that in poll_for_indication (https://github.com/wirepas/c-mesh-api/blob/master/lib/platform/linux/platform.c#L169) it would be cleaner to held the mutex also when computing the queue size. But the size is more informative here.
Only risk is to underestimate the free space and it is not an issue.
Sorry, something went wrong.
Linux Platfrom: add comment to clarify indication queue lock
4b7ab89
It was not clear why the indication queue is not locked when checking free space. #26
823bd9d
GwendalRaoul
No branches or pull requests
While doing upgrade from earlier WPC API library to c-mesh-api/master, we noticed this issue during code review.
In lib/platform/linux/platform.c, dispatch queue accesses indication queue with m_queue_mutex held. However, polling thread is accessing indication queue variables without taking mutex, for example at
https://github.com/wirepas/c-mesh-api/blob/master/lib/platform/linux/platform.c#L177
The text was updated successfully, but these errors were encountered: