RTEMS Logo

RTEMS 4.9.5 On-Line Library


Barrier Manager BARRIER_CREATE - Create a barrier

PREV UP NEXT Bookshelf RTEMS Ada User's Guide

20.4.1: BARRIER_CREATE - Create a barrier

CALLING SEQUENCE:

procedure Barrier_Create (
   Name            : in     RTEMS.Name;
   Attribute_Set   : in     RTEMS.Attribute;
   Maximum_Waiters : in     RTEMS.Unsigned32;
   ID              :    out RTEMS.ID;
   Result          :    out RTEMS.Status_Codes
);

DIRECTIVE STATUS CODES:

RTEMS.SUCCESSFUL - barrier created successfully
RTEMS.INVALID_NAME - invalid barrier name
RTEMS.INVALID_ADDRESS - id is NULL
RTEMS.TOO_MANY - too many barriers created@

DESCRIPTION:

This directive creates a barrier which resides on the local node. The created barrier has the user-defined name specified in name and the initial count specified in count. For control and maintenance of the barrier, RTEMS allocates and initializes a BCB. The RTEMS-assigned barrier id is returned in id. This barrier id is used with other barrier related directives to access the barrier.

RTEMS.BARRIER_MANUAL_RELEASE - only release

Specifying RTEMS.BARRIER_AUTOMATIC_RELEASE in attribute_set causes tasks calling the rtems.barrier_wait directive to block until there are maximum_waiters - 1 tasks waiting at the barrier. When the maximum_waiters task invokes the rtems.barrier_wait directive, the previous maximum_waiters - 1 tasks are automatically released and the caller returns.

In contrast, when the RTEMS.BARRIER_MANUAL_RELEASE attribute is specified, there is no limit on the number of tasks that will block at the barrier. Only when the rtems.barrier_release directive is invoked, are the tasks waiting at the barrier unblocked.

NOTES:

This directive will not cause the calling task to be preempted.

The following barrier attribute constants are defined by RTEMS:


PREV UP NEXT Bookshelf RTEMS Ada User's Guide

Copyright © 1988-2008 OAR Corporation