File: group__posix__cancel.html

package info (click to toggle)
xenomai 2.5.4-3squeeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 36,140 kB
  • ctags: 35,509
  • sloc: ansic: 109,084; sh: 11,745; makefile: 2,205; xml: 1,356; asm: 613; php: 316; perl: 155
file content (325 lines) | stat: -rw-r--r-- 24,147 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xenomai API: Thread cancellation.</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Thread cancellation.<br>
<small>
[<a class="el" href="group__posix__thread.html">Threads management services.</a>]</small>
</h1>
<p>
<div class="dynheader">
Collaboration diagram for Thread cancellation.:</div>
<div class="dynsection">
<center><table><tr><td><img src="group__posix__cancel.png" border="0" alt="" usemap="#group____posix____cancel_map">
<map name="group____posix____cancel_map">
<area shape="rect" href="group__posix__thread.html" title="Threads management services." alt="" coords="5,5,229,32"></map></td></tr></table></center>
</div>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Thread cancellation. 
<p>
Cancellation is the mechanism by which a thread can terminate the execution of a Xenomai POSIX skin thread (created with <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a>). More precisely, a thread can send a cancellation request to a Xenomai POSIX skin thread and depending on its cancelability type (see <a class="el" href="group__posix__cancel.html#g636480bad96654729ecf18017c2820cd" title="Set cancelability type of the current thread.">pthread_setcanceltype()</a>) and state (see <a class="el" href="group__posix__cancel.html#ge377201f61fae5f551dfd7eb6de75873" title="Set cancelability state of the current thread.">pthread_setcancelstate()</a>), the target thread can then either ignore the request, honor it immediately, or defer it till it reaches a cancellation point. When threads are first created by <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a>, they always defer cancellation requests.<p>
When a thread eventually honors a cancellation request, it behaves as if <em>pthread_exit(PTHREAD_CANCELED)</em> was called. All cleanup handlers are executed in reverse order, finalization functions for thread-specific data are called, and finally the thread stops executing. If the canceled thread was joinable, the return value PTHREAD_CANCELED is provided to whichever thread calls <a class="el" href="group__posix__thread.html#ga79c99cc7b194918a2def257246f11c6" title="Wait for termination of a specified thread.">pthread_join()</a> on it. See <a class="el" href="group__posix__thread.html#g090bdc13141e76205fab4cb3c5fab0e4" title="Terminate the current thread.">pthread_exit()</a> for more information.<p>
Cancellation points are the points where the thread checks for pending cancellation requests and performs them. The POSIX threads functions <a class="el" href="group__posix__thread.html#ga79c99cc7b194918a2def257246f11c6" title="Wait for termination of a specified thread.">pthread_join()</a>, <a class="el" href="group__posix__cond.html#g03a32b6f066162e62f274dfcb58338eb" title="Wait on a condition variable.">pthread_cond_wait()</a>, <a class="el" href="group__posix__cond.html#gfc43955fc3f1cb43723a9e0be19d0ad1" title="Wait a bounded time on a condition variable.">pthread_cond_timedwait()</a>, <a class="el" href="group__posix__cancel.html#gf1c95282ab2bea25f0888a19652cd41f" title="Test if a cancellation request is pending.">pthread_testcancel()</a>, <a class="el" href="group__posix__sem.html#g1b9226cb6b1c40511c025309c0b6b2ee" title="Lock a semaphore.">sem_wait()</a>, <a class="el" href="group__posix__sem.html#g8678e7f5136343ef8d8123a185878f78" title="Attempt, during a bounded time, to lock a semaphore.">sem_timedwait()</a>, <a class="el" href="group__posix__signal.html#gdc0d6eabea5878a70fe1f97b002f5f2a" title="Wait for signals.">sigwait()</a>, <a class="el" href="group__posix__signal.html#gc9043e9dc6fc22bfb82606932bb3b3ed" title="Wait for signals.">sigwaitinfo()</a> and <a class="el" href="group__posix__signal.html#g04cbfbf6045492b2273cc8046cd52d08" title="Wait during a bounded time for signals.">sigtimedwait()</a> are cancellation points.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/xsh_chap02_09.html#tag_02_09_05">Specification.</a> </dd></dl>

<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__cancel.html#g9e77a80c073787bf9a593e9c619dce27">pthread_cancel</a> (pthread_t thread)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Cancel a thread.  <a href="#g9e77a80c073787bf9a593e9c619dce27"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__cancel.html#g2032ad0c2fbd9d0af855da85ce314c36">pthread_cleanup_push</a> (cleanup_routine_t *routine, void *arg)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register a cleanup handler to be executed at the time of cancellation.  <a href="#g2032ad0c2fbd9d0af855da85ce314c36"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__cancel.html#gfbe33fb00cd24693796a0870a3374631">pthread_cleanup_pop</a> (int execute)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregister the last registered cleanup handler.  <a href="#gfbe33fb00cd24693796a0870a3374631"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__cancel.html#g636480bad96654729ecf18017c2820cd">pthread_setcanceltype</a> (int type, int *oldtype_ptr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set cancelability type of the current thread.  <a href="#g636480bad96654729ecf18017c2820cd"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__cancel.html#ge377201f61fae5f551dfd7eb6de75873">pthread_setcancelstate</a> (int state, int *oldstate_ptr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set cancelability state of the current thread.  <a href="#ge377201f61fae5f551dfd7eb6de75873"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__posix__cancel.html#gf1c95282ab2bea25f0888a19652cd41f">pthread_testcancel</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test if a cancellation request is pending.  <a href="#gf1c95282ab2bea25f0888a19652cd41f"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g9e77a80c073787bf9a593e9c619dce27"></a><!-- doxytag: member="cancel.c::pthread_cancel" ref="g9e77a80c073787bf9a593e9c619dce27" args="(pthread_t thread)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int pthread_cancel           </td>
          <td>(</td>
          <td class="paramtype">pthread_t&nbsp;</td>
          <td class="paramname"> <em>thread</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Cancel a thread. 
<p>
This service sends a cancellation request to the thread <em>thread</em> and returns immediately. Depending on the target thread cancelability state (see <a class="el" href="group__posix__cancel.html#ge377201f61fae5f551dfd7eb6de75873" title="Set cancelability state of the current thread.">pthread_setcancelstate()</a>) and type (see <a class="el" href="group__posix__cancel.html#g636480bad96654729ecf18017c2820cd" title="Set cancelability type of the current thread.">pthread_setcanceltype()</a>), its termination is either immediate, deferred or ignored.<p>
When the cancellation request is handled and before the thread is terminated, the cancellation cleanup handlers (registered with the <a class="el" href="group__posix__cancel.html#g2032ad0c2fbd9d0af855da85ce314c36" title="Register a cleanup handler to be executed at the time of cancellation.">pthread_cleanup_push()</a> service) are called, then the thread-specific data destructor functions (registered with <a class="el" href="group__posix__tsd.html#gf4b7ced8ecff505380fe8216244a3764" title="Create a thread-specific data key.">pthread_key_create()</a>).<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>ESRCH, the thread <em>thread</em> was not found.</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_cancel.html">Specification.</a> </dd></dl>

<p>References <a class="el" href="pod_8h-source.html#l00251">xnpod_schedule()</a>, and <a class="el" href="pod_8c-source.html#l01713">xnpod_unblock_thread()</a>.</p>

<p>Referenced by <a class="el" href="src_2skins_2native_2task_8c-source.html#l00257">rt_task_delete()</a>.</p>

</div>
</div><p>
<a class="anchor" name="gfbe33fb00cd24693796a0870a3374631"></a><!-- doxytag: member="cancel.c::pthread_cleanup_pop" ref="gfbe33fb00cd24693796a0870a3374631" args="(int execute)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pthread_cleanup_pop           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>execute</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unregister the last registered cleanup handler. 
<p>
If the calling thread is a Xenomai POSIX skin thread (i.e. created with <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a>), this service unregisters the last routine which was registered with <a class="el" href="group__posix__cancel.html#g2032ad0c2fbd9d0af855da85ce314c36" title="Register a cleanup handler to be executed at the time of cancellation.">pthread_cleanup_push()</a> and call it if <em>execute</em> is not null.<p>
If the caller context is invalid (not a Xenomai POSIX skin thread), this service has no effect.<p>
This service may be called at any place, but for maximal portability, should only called in the same lexical scope as the matching call to <a class="el" href="group__posix__cancel.html#g2032ad0c2fbd9d0af855da85ce314c36" title="Register a cleanup handler to be executed at the time of cancellation.">pthread_cleanup_push()</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>execute</em>&nbsp;</td><td>if non zero, the last registered cleanup handler should be executed before it is unregistered.</td></tr>
  </table>
</dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread,</li><li>Xenomai POSIX skin user-space thread (switches to primary mode).</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_cleanup_pop.html">Specification.</a> </dd></dl>

<p>Referenced by <a class="el" href="src_2skins_2native_2cond_8c-source.html#l00065">rt_cond_wait()</a>, and <a class="el" href="src_2skins_2native_2cond_8c-source.html#l00115">rt_cond_wait_until()</a>.</p>

</div>
</div><p>
<a class="anchor" name="g2032ad0c2fbd9d0af855da85ce314c36"></a><!-- doxytag: member="cancel.c::pthread_cleanup_push" ref="g2032ad0c2fbd9d0af855da85ce314c36" args="(cleanup_routine_t *routine, void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pthread_cleanup_push           </td>
          <td>(</td>
          <td class="paramtype">cleanup_routine_t *&nbsp;</td>
          <td class="paramname"> <em>routine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>arg</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Register a cleanup handler to be executed at the time of cancellation. 
<p>
This service registers the given <em>routine</em> to be executed a the time of cancellation of the calling thread, if this thread is a Xenomai POSIX skin thread (i.e. created with the <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a> service). If the caller context is invalid (not a Xenomai POSIX skin thread), this service has no effect.<p>
If allocation from the system heap fails (because the system heap size is to small), this service fails silently.<p>
The routines registered with this service get called in LIFO order when the calling thread calls <a class="el" href="group__posix__thread.html#g090bdc13141e76205fab4cb3c5fab0e4" title="Terminate the current thread.">pthread_exit()</a> or is canceled, or when it calls the <a class="el" href="group__posix__cancel.html#gfbe33fb00cd24693796a0870a3374631" title="Unregister the last registered cleanup handler.">pthread_cleanup_pop()</a> service with a non null argument.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>routine</em>&nbsp;</td><td>the cleanup routine to be registered;</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>arg</em>&nbsp;</td><td>the argument associated with this routine.</td></tr>
  </table>
</dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread,</li><li>Xenomai POSIX skin user-space thread (switches to primary mode).</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_cleanup_push.html">Specification.</a> </dd></dl>

<p>Referenced by <a class="el" href="src_2skins_2native_2cond_8c-source.html#l00065">rt_cond_wait()</a>, and <a class="el" href="src_2skins_2native_2cond_8c-source.html#l00115">rt_cond_wait_until()</a>.</p>

</div>
</div><p>
<a class="anchor" name="ge377201f61fae5f551dfd7eb6de75873"></a><!-- doxytag: member="cancel.c::pthread_setcancelstate" ref="ge377201f61fae5f551dfd7eb6de75873" args="(int state, int *oldstate_ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int pthread_setcancelstate           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>state</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>oldstate_ptr</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set cancelability state of the current thread. 
<p>
This service atomically set the cancelability state of the calling thread and returns its previous value at the address <em>oldstate_ptr</em>, if the calling thread is a Xenomai POSIX skin thread (i.e. created with the pthread_create service).<p>
The cancelability state of a POSIX thread may be:<ul>
<li>PTHREAD_CANCEL_ENABLE, meaning that cancellation requests will be handled if received;</li><li>PTHREAD_CANCEL_DISABLE, meaning that cancellation requests will not be handled if received.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>state</em>&nbsp;</td><td>new cancelability state of the calling thread;</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>oldstate_ptr</em>&nbsp;</td><td>address where the old cancelability state will be stored on success.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>state</em> is not a valid cancelability state;</li><li>EPERM, the caller context is invalid.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread,</li><li>Xenomai POSIX skin user-space thread (switches to primary mode).</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_setcancelstate.html">Specification.</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="g636480bad96654729ecf18017c2820cd"></a><!-- doxytag: member="cancel.c::pthread_setcanceltype" ref="g636480bad96654729ecf18017c2820cd" args="(int type, int *oldtype_ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int pthread_setcanceltype           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>oldtype_ptr</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set cancelability type of the current thread. 
<p>
This service atomically sets the cancelability type of the calling thread, and return its previous value at the address <em>oldtype_ptr</em>, if this thread is a Xenomai POSIX skin thread (i.e. was created with the <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a> service).<p>
The cancelability type of a POSIX thread may be:<ul>
<li>PTHREAD_CANCEL_DEFERRED, meaning that cancellation requests are only handled in services which are cancellation points;</li><li>PTHREAD_CANCEL_ASYNCHRONOUS, meaning that cancellation requests are handled as soon as they are sent.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>new cancelability type of the calling thread;</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>oldtype_ptr</em>&nbsp;</td><td>address where the old cancelability type will be stored on success.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success; <p>
an error number if:<ul>
<li>EINVAL, <em>type</em> is not a valid cancelability type;</li><li>EPERM, the caller context is invalid.</li></ul>
</dd></dl>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread,</li><li>Xenomai POSIX skin user-space thread (switches to primary mode).</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_setcanceltype.html">Specification.</a> </dd></dl>

<p>Referenced by <a class="el" href="src_2skins_2native_2cond_8c-source.html#l00065">rt_cond_wait()</a>, <a class="el" href="src_2skins_2native_2cond_8c-source.html#l00115">rt_cond_wait_until()</a>, <a class="el" href="src_2skins_2native_2intr_8c-source.html#l00044">rt_intr_wait()</a>, <a class="el" href="src_2skins_2native_2queue_8c-source.html#l00183">rt_queue_read()</a>, <a class="el" href="src_2skins_2native_2queue_8c-source.html#l00198">rt_queue_read_until()</a>, <a class="el" href="src_2skins_2native_2queue_8c-source.html#l00153">rt_queue_receive()</a>, <a class="el" href="src_2skins_2native_2queue_8c-source.html#l00168">rt_queue_receive_until()</a>, <a class="el" href="src_2skins_2native_2queue_8c-source.html#l00125">rt_queue_send()</a>, <a class="el" href="src_2skins_2native_2queue_8c-source.html#l00139">rt_queue_write()</a>, <a class="el" href="src_2skins_2native_2sem_8c-source.html#l00043">rt_sem_p()</a>, <a class="el" href="src_2skins_2native_2sem_8c-source.html#l00057">rt_sem_p_until()</a>, <a class="el" href="src_2skins_2native_2task_8c-source.html#l00399">rt_task_send()</a>, <a class="el" href="src_2skins_2native_2task_8c-source.html#l00180">rt_task_shadow()</a>, <a class="el" href="src_2skins_2native_2task_8c-source.html#l00314">rt_task_sleep()</a>, <a class="el" href="src_2skins_2native_2task_8c-source.html#l00327">rt_task_sleep_until()</a>, and <a class="el" href="src_2skins_2native_2task_8c-source.html#l00294">rt_task_wait_period()</a>.</p>

</div>
</div><p>
<a class="anchor" name="gf1c95282ab2bea25f0888a19652cd41f"></a><!-- doxytag: member="cancel.c::pthread_testcancel" ref="gf1c95282ab2bea25f0888a19652cd41f" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pthread_testcancel           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Test if a cancellation request is pending. 
<p>
This function creates a cancellation point if the calling thread is a Xenomai POSIX skin thread (i.e. created with the <a class="el" href="group__posix__thread.html#ge6e819ed048e4c4a4ee96fa6f426852c" title="Create a thread.">pthread_create()</a> service).<p>
This function is a cancellation point. It has no effect if cancellation is disabled.<p>
<dl class="user" compact><dt><b>Valid contexts:</b></dt><dd><ul>
<li>Xenomai POSIX skin kernel-space thread,</li><li>Xenomai POSIX skin user-space thread (switches to primary mode).</li></ul>
</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_testcancel.html">Specification.</a> </dd></dl>

<p>Referenced by <a class="el" href="src_2skins_2native_2cond_8c-source.html#l00065">rt_cond_wait()</a>, and <a class="el" href="src_2skins_2native_2cond_8c-source.html#l00115">rt_cond_wait_until()</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 2 12:48:40 2010 for Xenomai API by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>