Fillod Stephane wrote:
> Perrine Martignoni wrote:
> [..]
>
>>int DESTRUCT=0;
>
>
> I'm always nervous to see global variables shared among threads without
> a volatile keyword. An explicit memory barrier would be better, as it
> has been re-explained in a LWN article lately (wait Thursday for free access)
> http://lwn.net/Articles/233479/
>
> But the problem in routine2 is somewhere else:
>
> void routine2 (void * cookie){
> int ret;
> struct sched_param param = {.sched_priority = 10 };
> pthread_setschedparam(pthread_self(), SCHED_FIFO, ¶m);
> for(;;){
> affich(2);
> ret = mq_send(mq2, buf2, MSG_SIZE, 0);
> printf("send mq2 returned %d, errno %s\n", ret, errno );
> ouch! ^^ ^^^^^
> ret = mq_receive(mq1, buf1, MSG_SIZE, NULL );
> printf("receive mq1 returned %d, errno %s\n", ret, errno);
> ouch! ^^ ^^^^^
>
>
> This should be either
> printf("receive mq1 returned %d, errno %d\n", ret, errno);
> or
> printf("receive mq1 returned %d, errno %s\n", ret,
> strerror(errno));
Yes, I did not look at gcc warnings long enough. Yet another error (but
this one is arguably a bug in Xenomai posix skin) is to pass a null
pointer as last argument of mq_receive.
--
Gilles Chanteperdrix
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help