This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LCK_post

 

I have an application where I use a LCK object to synchronize access to a shared memory object. Generally I have paired pend and post operations. I understand that I can have multiple pend operations in the same task as long as I have an equivalent number of posts. What happens when I have more posts than pends. In other words:

 

 LCK_pend(lock, 1000)

< --- Do Something ---> 

LCK_post(lock);

<- --- do something --->

LCK_post(lock);

From what I can see in my code, it seems to put the LCK object in a weird state and continually blocks any access to the lock.

I'm using DSP/BIOS 5.32. Has anyone encountered this? Can anyone confirm this behavior? Other than switching to a semaphore, is there any way that I can check the state of the LCK prior to calling post?

 

Thanks,

~C

 

 

  • I have not come across this myself, and from what I have read in the BIOS documentation I have not seen any limitation on the number of LCK_post calls you can make, I would like to think that additional LCK_post calls would be ignored. In any case I have moved your question here to the CCS forum as this is a generic BIOS RTOS question, and the CCS forum is the closer to a generic software tools forum, hopefully someone in here can comment further.

  • I know it's been a while - did you ever find out what was causing the blocked lock? I am running in the same situation, where a lock can not be obtained although it is apparently free (Debugger shows owner=0x0, count=0). I carefully examined the code and could not find anything wrong with the usage of the lock - every pend is followed by a post.