RTEMS semaphores - binary or counting by default?
Joel Sherrill
joel.sherrill at OARcorp.com
Thu Nov 20 14:21:03 UTC 2003
Rickard Westman wrote:
> Hi,
>
> I think I've found an inconsistency between the implementation and
> documentation for RTEMS 4.6.0pre5, concerning the default attributes for
> semaphores. According to the documentation ("RTEMS C User's Guide,
> Edition 4.6.0pre5"), semaphores are binary by default. This does not
> seem to agree with the defines in attr.h, however, where we have:
>
> #define RTEMS_DEFAULT_ATTRIBUTES 0x00000000
> (...)
> #define RTEMS_COUNTING_SEMAPHORE 0x00000000
> #define RTEMS_BINARY_SEMAPHORE 0x00000010
> #define RTEMS_SIMPLE_BINARY_SEMAPHORE 0x00000020
>
> This means that if RTEMS_DEFAULT_ATTRIBUTES is used (or some attribute
> symbol other than the above) you get a counting semaphore instead of the
> expected binary one.
>
You are correct. The documentation is incorrect. I checked the CVS
history for attr.h back to about 1995 and binary was never the default.
I filed it as PR521.
--
Joel Sherrill, Ph.D. Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list