RTEMS semaphores - binary or counting by default?

Rickard Westman rickard.westman at 27m.se
Thu Nov 20 00:27:52 UTC 2003


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.

-- 
Rickard Westman                Phone: +46 13 218123
Software Engineer              GSM:   +46 70 3020918
27M Technologies               Email: rwestman (at) 27m (dot) se




More information about the users mailing list