Ejemplo n.º 1
0
rtems_status_code rtems_barrier_wait(
  rtems_id        id,
  rtems_interval  timeout
)
{
  Barrier_Control   *the_barrier;
  Objects_Locations  location;

  the_barrier = _Barrier_Get( id, &location );
  switch ( location ) {
    case OBJECTS_REMOTE:
    case OBJECTS_ERROR:
      return RTEMS_INVALID_ID;

    case OBJECTS_LOCAL:
      _CORE_barrier_Wait(
        &the_barrier->Barrier,
        id,
        TRUE,
        timeout,
        NULL
      );
      _Thread_Enable_dispatch();
      return _Barrier_Translate_core_barrier_return_code(
                _Thread_Executing->Wait.return_code );

  }

  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
}
Ejemplo n.º 2
0
rtems_status_code rtems_barrier_wait(
  rtems_id        id,
  rtems_interval  timeout
)
{
  Barrier_Control  *the_barrier;
  ISR_lock_Context  lock_context;
  Thread_Control   *executing;

  the_barrier = _Barrier_Get( id, &lock_context );

  if ( the_barrier == NULL ) {
    return RTEMS_INVALID_ID;
  }

  executing = _Thread_Executing;
  _CORE_barrier_Seize(
    &the_barrier->Barrier,
    executing,
    true,
    timeout,
    NULL,
    0,
    &lock_context
  );
  return _Barrier_Translate_core_barrier_return_code(
    executing->Wait.return_code
  );
}
Ejemplo n.º 3
0
rtems_status_code rtems_barrier_wait(
    rtems_id        id,
    rtems_interval  timeout
)
{
    Barrier_Control   *the_barrier;
    Objects_Locations  location;

    the_barrier = _Barrier_Get( id, &location );
    switch ( location ) {

    case OBJECTS_LOCAL:
        _CORE_barrier_Wait(
            &the_barrier->Barrier,
            id,
            true,
            timeout,
            NULL
        );
        _Thread_Enable_dispatch();
        return _Barrier_Translate_core_barrier_return_code(
                   _Thread_Executing->Wait.return_code );

#if defined(RTEMS_MULTIPROCESSING)
    case OBJECTS_REMOTE:
#endif
    case OBJECTS_ERROR:
        break;
    }

    return RTEMS_INVALID_ID;
}