source: rtems/cpukit/posix/src/testcancel.c @ 1d572eba

5
Last change on this file since 1d572eba was da826560, checked in by Sebastian Huber <sebastian.huber@…>, on 05/13/16 at 08:28:14

posix: Rework thread cancellation

Add Thread_Life_state::THREAD_LIFE_CHANGE_DEFERRED and rework the POSIX
thread cancellation to use the thread life states.

Update #2555.
Update #2626.

  • Property mode set to 100644
File size: 743 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Setting test on Cancelability State
5 * @ingroup POSIXAPI
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  Copyright (c) 2016 embedded brains GmbH.
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#if HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include <pthread.h>
24
25#include <rtems/score/isr.h>
26#include <rtems/score/threadimpl.h>
27
28/*
29 *  18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
30 */
31
32void pthread_testcancel( void )
33{
34  if ( _ISR_Is_in_progress() ) {
35    return;
36  }
37
38  _Thread_Change_life( 0, 0, THREAD_LIFE_CHANGE_DEFERRED );
39}
Note: See TracBrowser for help on using the repository browser.