source: rtems/cpukit/posix/include/rtems/posix/pthreadattrimpl.h @ 2be22d4

5
Last change on this file since 2be22d4 was bd5be58f, checked in by Sebastian Huber <sebastian.huber@…>, on 10/10/17 at 05:18:09

posix: Unconditional thread attribute support

Update #2514.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief POSIX Threads Private Support
5 *
6 * This include file contains all the private support information for
7 * POSIX threads.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2011.
12 *  On-Line Applications Research Corporation (OAR).
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#ifndef _RTEMS_POSIX_PTHREADATTRIMPL_H
20#define _RTEMS_POSIX_PTHREADATTRIMPL_H
21
22#include <errno.h>
23#include <pthread.h>
24
25#include <rtems/score/basedefs.h>
26#include <rtems/score/assert.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32/**
33 * @addtogroup POSIX_PTHREAD
34 */
35/**@{**/
36
37/**
38 * This variable contains the default POSIX Thread attributes.
39 */
40extern const pthread_attr_t _POSIX_Threads_Default_attributes;
41
42RTEMS_INLINE_ROUTINE void _POSIX_Threads_Copy_attributes(
43  pthread_attr_t        *dst_attr,
44  const pthread_attr_t  *src_attr
45)
46{
47  *dst_attr = *src_attr;
48  _Assert(
49    dst_attr->affinitysetsize == sizeof(dst_attr->affinitysetpreallocated)
50  );
51  dst_attr->affinityset = &dst_attr->affinitysetpreallocated;
52}
53
54RTEMS_INLINE_ROUTINE void _POSIX_Threads_Initialize_attributes(
55  pthread_attr_t  *attr
56)
57{
58  _POSIX_Threads_Copy_attributes(
59    attr,
60    &_POSIX_Threads_Default_attributes
61  );
62}
63
64/** @} */
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif
71/*  end of include file */
Note: See TracBrowser for help on using the repository browser.