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