1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <meta http-equiv=
"Content-Type" content=
"text/xhtml;charset=UTF-8"/>
5 <title>Xenomai API: event_flags.c
</title>
6 <link href=
"tabs.css" rel=
"stylesheet" type=
"text/css"/>
7 <link href=
"doxygen.css" rel=
"stylesheet" type=
"text/css"/>
10 <!-- Generated by Doxygen 1.7.1 -->
11 <div class=
"navigation" id=
"top">
14 <li><a href=
"main.html"><span>Main
Page
</span></a></li>
15 <li><a href=
"pages.html"><span>Related
Pages
</span></a></li>
16 <li><a href=
"modules.html"><span>Modules
</span></a></li>
17 <li><a href=
"annotated.html"><span>Data
Structures
</span></a></li>
18 <li><a href=
"files.html"><span>Files
</span></a></li>
19 <li><a href=
"examples.html"><span>Examples
</span></a></li>
24 <div class=
"headertitle">
25 <h1>event_flags.c
</h1> </div>
27 <div class=
"contents">
28 <div class=
"fragment"><pre class=
"fragment"><span class=
"preprocessor">#include
<<a class=
"code" href=
"event_8h.html" title=
"This file is part of the Xenomai project.">native/event.h
</a>></span>
30 <span class=
"preprocessor">#define EVENT_INIT
0x0 </span><span class=
"comment">/* No flags present at init */
</span>
31 <span class=
"preprocessor">#define EVENT_MODE EV_PRIO
</span><span class=
"comment">/* Tasks will wait by priority order */
</span>
32 <span class=
"preprocessor">#define EVENT_WAIT_MASK (
0x1|
0x2|
0x4)
</span><span class=
"comment">/* List of monitored events */
</span>
33 <span class=
"preprocessor">#define EVENT_SIGNAL_MASK (
0x2)
</span><span class=
"comment">/* List of events to send */
</span>
37 <span class=
"keywordtype">void
</span> foo (
<span class=
"keywordtype">void
</span>)
40 <span class=
"keywordtype">unsigned
</span> <span class=
"keywordtype">long
</span> mask_ret;
41 <span class=
"keywordtype">int
</span> err;
43 <span class=
"comment">/* Create an event flag; we could also have attempted to bind to
</span>
44 <span class=
"comment"> some pre-existing object, using rt_event_bind() instead of
</span>
45 <span class=
"comment"> creating it. */
</span>
47 err =
<a name=
"a0"></a><a class=
"code" href=
"group__event.html#ga8b0fbb2b816c62081afe86bf897c503c" title=
"Create an event group.">rt_event_create
</a>(
&ev_desc,
48 <span class=
"stringliteral">"MyEventFlagGroup
"</span>,
52 <span class=
"comment">/* Now, wait for some task to post some event flags... */
</span>
54 err =
<a name=
"a1"></a><a class=
"code" href=
"group__event.html#ga6e9f775275661d9258f8b1eb02fe4681" title=
"Pend on an event group.">rt_event_wait
</a>(
&ev_desc,
57 EV_ANY,
<span class=
"comment">/* Disjunctive wait */
</span>
59 <span class=
"comment">/* ... */
</span>
62 <span class=
"keywordtype">void
</span> bar (
<span class=
"keywordtype">void
</span>)
65 <span class=
"comment">/* ... */
</span>
67 <span class=
"comment">/* Post some events. */
</span>
69 <a name=
"a2"></a><a class=
"code" href=
"group__event.html#gafda4c544f2429005c4b15de3a7ffc902" title=
"Post an event group.">rt_event_signal
</a>(
&ev_desc,EVENT_SIGNAL_MASK);
71 <span class=
"comment">/* ... */
</span>
74 <span class=
"keywordtype">void
</span> cleanup (
<span class=
"keywordtype">void
</span>)
77 <a name=
"a3"></a><a class=
"code" href=
"group__event.html#gabccfea1cd018493ef5a28c6fe8e90d7c" title=
"Delete an event group.">rt_event_delete
</a>(
&ev_desc);
81 <hr class=
"footer"/><address class=
"footer"><small>Generated on Wed Nov
2 2011 18:
01:
06 for Xenomai API by
82 <a href=
"http://www.doxygen.org/index.html">
83 <img class=
"footer" src=
"doxygen.png" alt=
"doxygen"/></a> 1.7.1 </small></address>