2nd thread not able to receive messages via message queue sent by thread 1 in C/C++/linux

view story

http://stackoverflow.com – I am simulating a udp server which receives multiple request messages via udp client. I need to spawn 2 threads in this udp server sample code. thread 1 will receive all the udp request as and when they arrive and sent it to thread 2 via message queue for processing. thread 1(SndMq) is able to receive the request message at via udp and also able to put it in message queue using a structure. But the problem is the thread 2(RcvMq) is not able to read even single message in the message queue. Please suggest any solution. Error part (thread 2 function): void* RcvMq(void*) { time_t t2; (HowTos)