source: rtems/cpukit/posix/src/pthreadexit.c @ dbb30e26

5
Last change on this file since dbb30e26 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: 835 bytes
Line 
1/**
2 * @file
3 *
4 * @brief POSIX Thread Exit Shared Helper
5 * @ingroup POSIX_THREAD Thread API Extension
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2011.
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/threadimpl.h>
26
27void pthread_exit( void *value_ptr )
28{
29  Thread_Control  *executing;
30  Per_CPU_Control *cpu_self;
31
32  cpu_self = _Thread_Dispatch_disable();
33  executing = _Per_CPU_Get_executing( cpu_self );
34
35  _Thread_Exit( executing, THREAD_LIFE_TERMINATING, value_ptr );
36
37  _Thread_Dispatch_enable( cpu_self );
38  RTEMS_UNREACHABLE();
39}
Note: See TracBrowser for help on using the repository browser.