source: rtems/cpukit/posix/include/rtems/posix/barrierimpl.h @ 631b3c8

5
Last change on this file since 631b3c8 was 631b3c8, checked in by Sebastian Huber <sebastian.huber@…>, on 05/23/16 at 09:40:18

score: Move thread queue MP callout to context

Drop the multiprocessing (MP) dependent callout parameter from the
thread queue extract, dequeue, flush and unblock methods. Merge this
parameter with the lock context into new structure Thread_queue_Context.
This helps to gets rid of the conditionally compiled method call
helpers.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief Inlined Routines from the POSIX Barrier Manager
5 *
6 * This file contains the static inlin implementation of the inlined
7 * routines from the POSIX Barrier Manager.
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_BARRIERIMPL_H
20#define _RTEMS_POSIX_BARRIERIMPL_H
21
22#include <rtems/posix/barrier.h>
23#include <rtems/score/corebarrierimpl.h>
24#include <rtems/score/objectimpl.h>
25
26#include <errno.h>
27#include <pthread.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/**
34 *  The following defines the information control block used to manage
35 *  this class of objects.
36 */
37
38extern Objects_Information _POSIX_Barrier_Information;
39
40/**
41 * @brief POSIX translate barrier return code.
42 *
43 * This routine translates SuperCore Barrier status codes into the
44 * corresponding POSIX ones.
45 *
46 * @param[in] the_barrier_status is the SuperCore status.
47 *
48 * @return the corresponding POSIX status
49 */
50int _POSIX_Barrier_Translate_core_barrier_return_code(
51  CORE_barrier_Status  the_barrier_status
52);
53
54/**
55 * @brief Allocate a barrier control block.
56 *
57 * This function allocates a barrier control block from
58 * the inactive chain of free barrier control blocks.
59 */
60RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void )
61{
62  return (POSIX_Barrier_Control *)
63    _Objects_Allocate( &_POSIX_Barrier_Information );
64}
65
66/**
67 * @brief Free a barrier control block.
68 *
69 * This routine frees a barrier control block to the
70 * inactive chain of free barrier control blocks.
71 */
72RTEMS_INLINE_ROUTINE void _POSIX_Barrier_Free (
73  POSIX_Barrier_Control *the_barrier
74)
75{
76  _CORE_barrier_Destroy( &the_barrier->Barrier );
77  _Objects_Free( &_POSIX_Barrier_Information, &the_barrier->Object );
78}
79
80RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Get(
81  const pthread_barrier_t *barrier,
82  Thread_queue_Context    *queue_context
83)
84{
85  _Thread_queue_Context_initialize( queue_context, NULL );
86  return (POSIX_Barrier_Control *) _Objects_Get(
87    (Objects_Id) *barrier,
88    &queue_context->Lock_context,
89    &_POSIX_Barrier_Information
90  );
91}
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif
98/*  end of include file */
Note: See TracBrowser for help on using the repository browser.