bound_task.c

来自「xenomai 很好的linux实时补丁」· C语言 代码 · 共 26 行

C
26
字号
#include <native/task.h>#define SIGNALS (0x1|0x4) /* Signals to send */RT_TASK task_desc;int main (int argc, char *argv[]){    int err;    mlockall(MCL_CURRENT|MCL_FUTURE);    /* Bind to a task which has been created elsewhere, either in       kernel or user-space. The call will block us until such task is       created with the expected name.  */    err = rt_task_bind(&task_desc,"SomeTaskName",TM_NONBLOCK);    if (!err)	/* Send signals to the bound task */	rt_task_notify(&task_desc,SIGNALS);    /* ... */}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?