source: rtems/cpukit/posix/include/rtems/posix/threadsup.h @ a2e3f33

4.115
Last change on this file since a2e3f33 was a2e3f33, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 11:50:54

score: Create object implementation header

Move implementation specific parts of object.h and object.inl into new
header file objectimpl.h. The object.h contains now only the
application visible API.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief POSIX Thread API Support
5 *
6 * This defines the POSIX thread API extension.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2011.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 */
17
18#ifndef _RTEMS_POSIX_THREADSUP_H
19#define _RTEMS_POSIX_THREADSUP_H
20
21#include <rtems/score/coresem.h>
22#include <rtems/score/thread.h>
23#include <rtems/score/threadq.h>
24#include <rtems/score/watchdog.h>
25
26#include <pthread.h>
27#include <signal.h>
28
29/**
30 *  @defgroup POSIX_THREAD POSIX Thread API Extension
31 *
32 *  @ingroup POSIXAPI
33 *
34 */
35/**@{**/
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/**
41 * This defines the POSIX API support structure associated with
42 * each thread in a system with POSIX configured.
43 */
44typedef struct {
45  /** This is the POSIX threads attribute set. */
46  pthread_attr_t          Attributes;
47  /** This indicates whether the thread is attached or detached. */
48  int                     detachstate;
49  /** This is the set of threads waiting for the thread to exit. */
50  Thread_queue_Control    Join_List;
51  /** This is the thread's current scheduling policy. */
52  int                     schedpolicy;
53  /** This is the thread's current set of scheduling parameters. */
54  struct sched_param      schedparam;
55  /**
56   * This is the high priority to execute at when using the sporadic
57   * scheduler.
58   */
59  int                     ss_high_priority;
60  /**
61   * This is the timer which controls when the thread executes at
62   * high and low priority when using the sporadic scheduler.
63   */
64  Watchdog_Control        Sporadic_timer;
65
66  /** This is the set of signals which are currently blocked. */
67  sigset_t                signals_blocked;
68  /** This is the set of signals which are currently pending. */
69  sigset_t                signals_pending;
70
71  /*******************************************************************/
72  /*******************************************************************/
73  /***************         POSIX Cancelability         ***************/
74  /*******************************************************************/
75  /*******************************************************************/
76
77  /** This is the cancelability state. */
78  int                     cancelability_state;
79  /** This is the cancelability type. */
80  int                     cancelability_type;
81  /** This indicates if a cancelation has been requested. */
82  int                     cancelation_requested;
83  /** This is the set of cancelation handlers. */
84  Chain_Control           Cancellation_Handlers;
85
86} POSIX_API_Control;
87
88/**
89 * @brief POSIX thread exit shared helper.
90 *
91 * 16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
92 *
93 * This method is a helper routine which ensures that all
94 * POSIX thread calls which result in a thread exiting will
95 * do so in the same manner.
96 *
97 * @param[in] the_thread is a pointer to the thread exiting or being canceled
98 * @param[in] value_ptr is a pointer the value to be returned by the thread
99 *
100 * NOTE: Key destructors are executed in the POSIX api delete extension.
101 *
102 */
103void _POSIX_Thread_Exit(
104  Thread_Control *the_thread,
105  void           *value_ptr
106);
107
108/** @} */
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif
115/* end of include file */
Note: See TracBrowser for help on using the repository browser.