source: rtems/cpukit/posix/src/condget.c @ 04da96c7

5
Last change on this file since 04da96c7 was 21789a21, checked in by Sebastian Huber <sebastian.huber@…>, on 07/28/15 at 12:45:42

score: Rename _POSIX_Absolute_timeout_to_ticks()

Rename _POSIX_Absolute_timeout_to_ticks() to
_TOD_Absolute_timeout_to_ticks() and move it to the score directory.
Delete empty <rtems/posix/time.h>.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2007.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#if HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <pthread.h>
15#include <errno.h>
16
17#include <rtems/system.h>
18#include <rtems/score/watchdog.h>
19#include <rtems/posix/condimpl.h>
20#include <rtems/posix/muteximpl.h>
21
22POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get (
23  pthread_cond_t    *cond,
24  Objects_Locations *location
25)
26{
27  int status;
28
29  if ( !cond ) {
30    *location = OBJECTS_ERROR;
31    return (POSIX_Condition_variables_Control *) 0;
32  }
33
34  if ( *cond == PTHREAD_COND_INITIALIZER ) {
35    /*
36     *  Do an "auto-create" here.
37     */
38
39    status = pthread_cond_init( cond, 0 );
40    if ( status ) {
41      *location = OBJECTS_ERROR;
42      return (POSIX_Condition_variables_Control *) 0;
43    }
44  }
45
46  /*
47   *  Now call Objects_Get()
48   */
49  return (POSIX_Condition_variables_Control *)_Objects_Get(
50    &_POSIX_Condition_variables_Information,
51    (Objects_Id) *cond,
52    location
53  );
54}
55
Note: See TracBrowser for help on using the repository browser.