Xenomai 检测某一线程从Xenomai域切换到Linux域

来源:互联网 发布:linux脚本显示日期格式 编辑:程序博客网 时间:2024/06/08 17:31

Using the PTHREAD_WARNSW bit

This Xenomai feature enables run-time checks on a per-thread basis.

To enable these checks for the current thread use:

pthread_set_mode_np(0, PTHREAD_WARNSW);

As this call is specific to Xenomai (as indicated by the _np suffix), you maywant to surround it with a #ifdef __XENO__.

This will detect run-time errors and cause a SIGXCPU signal to be sent to thethread, you will find an example of a way to use this signal in the fileexamples/native/sigxcpu.c in Xenomai sources distribution. 

另外:发SIGXCPU信号的处理在:xnshadow_relax->if (xnthread_test_state(thread, XNTRAPSW))->xnsynch_detect_claimed_relax(thread);

参考:

http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/skins/native/snippets/sigxcpu.c

http://comments.gmane.org/gmane.linux.real-time.xenomai.users/1179

0 0
原创粉丝点击