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

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

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

for(;:wink:
{
// 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