In general, an attribute set is built by a bitwise OR of the desired attribute components. The following table lists the set of valid barrier attributes:
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)
NOTE: Barriers only support FIFO blocking order because all waiting tasks are released as a set. Thus the released tasks will all become ready to execute at the same time and compete for the processor based upon their priority.
Attribute values are specifically designed to be
mutually exclusive, therefore bitwise OR and addition operations
are equivalent as long as each attribute appears exactly once in
the component list. An attribute listed as a default is not
required to appear in the attribute list, although it is a good
programming practice to specify default attributes. If all
defaults are desired, the attribute
RTEMS.DEFAULT_ATTRIBUTES
should be
specified on this call.
This example demonstrates the attribute_set parameter needed to create a
barrier with the automatic release policy. The
attribute_set
parameter passed to the
rtems.barrier_create
directive will be
RTEMS.BARRIER_AUTOMATIC_RELEASE
. In this case, the
user must also specify the maximum_waiters parameter.
Copyright © 1988-2008 OAR Corporation