Mutex problem

Leon Pollak leonp at plris.com
Tue Mar 29 07:02:11 UTC 2011


Hello, all.

I am running 4.8.0 and have some strange situation (below). Are there any 
known problems in this version with mutexes?
---
Two tasks A (prio 2) and B (prio 135) are competing on a resource protected by 
mutex (FIFO mode). I made memory logger, which logs each suspicious point both 
tasks path.
It also logs the value (I k ow the number of the semaphore to be 25):
((Semaphore_Control*)_Semaphore_Information.local_table[25])-
>Core_control.mutex.lock

What I see is that A enters (lock=1), obtains the mutex (lock=0), starts 
processing, waits for the I/O and at this point B enters and stands waiting 
for the mutex. lock=0 all the time, which seems correct.

Then, A finishes, (lock=0), RELEASES the mutex - lock still is 0!!?? 
Here I supposed, that the token was implicitly passed to task B, although it 
does not run yet. 
OK, now B continues, releases the semaphore, but lock again is 0. And remains 
as such forever. The system is succefully blocked and does nothing..:-)

When I ask for semaphore state with the help of GDB macros, I see that 
semaphore is held by task B.

Any hint will be highly appreciated.
-- 
Leon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20110329/ea46d734/attachment.html>


More information about the users mailing list