Jens Köhler wrote:
> Hello Gilles,
>  
> here is the code:
>  
> RT_QUEUE myqueue;
> int retval;
> retval = rt_queue_create(&myqueue, "myqueue", 255, 10, Q_FIFO);
>  
> char message[100] = "Message ";
> retval = rt_queue_write(&myqueue,message,sizeof(message),Q_NORMAL);
> //retval is 0
>  
> char msgBuf[255];
> retval = rt_queue_read(&myqueue, msgBuf, sizeof(msgBuf), TM_NONBLOCK);
> //retval is always -1, why?

Probably because the callling thread is not a Xenomai thread, it is a
simple Linux thread, and as such, is not allowed to switch to primary
mode as is required by rt_queue_read.

-- 
                                            Gilles.


_______________________________________________
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help

Reply via email to