Relative Content

Tag Archive for c++message-queuevxworksposix-mq

Message Queue causing core dump when checking is message available

When I’m trying to check if new message is available in message queue, I’m getting core dump error.
I’m calling isDataAvailableInReceiveDataQueue method to check if data is available in message queue.
I’m using mq_getattr function to read number available of messages queue and checking the mq_curmsgs variable in struct mq_attr structure.
If attr.mq_curmsgs>0; I treat new data is available.
I’m getting core dump error on return true.