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 );
RTEMS.SUCCESSFUL
- barrier created successfully
RTEMS.INVALID_NAME
- invalid barrier name
RTEMS.INVALID_ADDRESS
- id
is NULL
RTEMS.TOO_MANY
- too many barriers created@
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.
This directive will not cause the calling task to be preempted.
The following barrier attribute constants are defined by RTEMS:
RTEMS.BARRIER_AUTOMATIC_RELEASE
- automatically
release the barrier when the configured number of tasks are blocked
RTEMS.BARRIER_MANUAL_RELEASE
- only release
the barrier when the application invokes the
rtems.barrier_release
directive. (default)
Copyright © 1988-2007OAR Corporation