How to reflesh the PULSE queue of MsgReceivePulse()??

bridged with qdn.public.qnxrtp.x86
Post Reply
Hichun Chen

How to reflesh the PULSE queue of MsgReceivePulse()??

Post by Hichun Chen » Fri Apr 11, 2003 1:57 am

The pulse will automatically queue by its priority,when receiving thread
didn't block on REC_BLOCK state.But now I want to use the latest pulse no
matter how many pulses in the queue,in other words,how to reflesh or clear
the queue?

thanks.

--
http://hichun.nease.net
hcchen@ipp.ac.cn
Hichun Chen

Artem Smolenkov

Re: How to reflesh the PULSE queue of MsgReceivePulse()??

Post by Artem Smolenkov » Fri Apr 11, 2003 12:59 pm

You can use TimerTimeout() + MsgReceivePulse() to clear the queue:

for(;;)
{
// dont't block if there's no pulse
if ( TimerTimeout(CLOCK_REALTIME,_NTO_TIMEOUT_RECEIVE,NULL,NULL,NULL) <
0 ) break; // error
rcvid = MsgReceivePulse_r( chid, &pulse, sizeof( pulse ), NULL );
if ( rcvid < 0) break; // no more queued pulses
}

Artem

"Hichun Chen" <hcchen@mail.ipp.ac.cn> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:b756f2$a7e$1@inn.qnx.com...
The pulse will automatically queue by its priority,when receiving thread
didn't block on REC_BLOCK state.But now I want to use the latest pulse no
matter how many pulses in the queue,in other words,how to reflesh or clear
the queue?

thanks.

--
http://hichun.nease.net
hcchen@ipp.ac.cn
Hichun Chen

Post Reply

Return to “qdn.public.qnxrtp.x86”