Gilles Chanteperdrix wrote:
> Jeff Webb wrote:
>  > Jan Kiszka wrote:
>  > >>   /* Shut down the real-time thread */
>  > >>   pthread_cancel (fifotest_task);
>  > >>   pthread_join (fifotest_task, NULL);  
>  > > 
>  > > pthread_join requires RT context and will not work as expected. But
>  > > that's unrelated to this problem.
>  > 
>  > Okay.  (I now see this restriction in the docs.)  What is the proper way 
> to do this cleanup from kernel-space with Xenomai?  (Pardon my asking, as I 
> haven't done much programming using POSIX threads.  I believe this syntax was 
> suggested, or at least acceptable, with RTLinux.)
> 
> Calling pthread_cancel then pthread_join from a module cleanup routine
> should work. Because the cancelled thread preempts immediately the
> module cleanup routine, so when pthread_join is called, the thread no
> longer exists and there is no need to suspend the calling thread.
> 

Yes, but only on UP. What about including a simple polling loop into
kernel-space pthread_join, something like rtdm_task_join_nrt?

Jan


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to