We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I'm using the RT-lib and was wondering what happens if a semaphore is initiated multiple times during.
Does this reset the token-counter of the semaphore, or will it simply return without doing anything at all?
Is the semaphore registered somewhere when os_sem_init() is called that could mean memory leakage if it is initiated multiple times?
I'm thankful for any answers.
Best Regards /Ake Forslund
Ã…ke, The below text is my opinion - I don't know for sure! It does not make sense that re-initializing a synchronization primitive would break other pieces of software - if there are tasks waiting for that semaphore, resetting its counter will potentially cause a disaster, that might stem from a silly programming mistake. It is more likely that the semaphore is left alone if there are tasks waiting on it, but you should ask Keil support to be sure. If you have access to the memory manager, you might be able to determine whether there is a memory leak or not.