Semaphore - Task priority queueing not working

Binkowski, Cassio cassioiks at gmail.com
Tue Jul 24 02:57:31 UTC 2012


Hello

I am creating a Semaphore where Tasks are queued by priority, and yet a
Task with lower priority stands in front of a higher priority task.

Here are the steps I'm following:

1) Create a Semaphore;
2) Task 1, with priority 1, obtains the Semaphore;
3) Task 2, with priority 3, tries to obtain the Semaphore with "wait for
ever condition";
4) Task 3, with priority 2, tries to obtain the Semaphore with "wait for
ever condition";
5) Task 1 releases the Semaphore;
6) Task 2 obtains the Semaphore. *---> This is where Task 3 should obtains
the **Semaphore, because of the Priority.*

This is how I'm creating the Semaphore:

status = rtems_semaphore_create(
rtems_build_name('S','M','P','R'),
 1,
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_GLOBAL,
0,
 &semaphoreId
);


What am I doing wrong?

Best regards
Cassio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20120723/4aaa79b4/attachment.html>


More information about the users mailing list