现在的位置: 首页 > 综合 > 正文

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

2017年11月13日 ⁄ 综合 ⁄ 共 705字 ⁄ 字号 评论关闭

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

抱歉!评论已关闭.