This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RL-ARM Multiple initiations of Semaphore

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

Parents
  • If a task is pending on a semaphore and you initialize the semaphore again, the pending task is deadlocked forever. If a pending task is waiting with a timeout, the behaviour of RTX is unpredictable since the cahained link is broken. Most likely the application will crash.

    Franc

Reply
  • If a task is pending on a semaphore and you initialize the semaphore again, the pending task is deadlocked forever. If a pending task is waiting with a timeout, the behaviour of RTX is unpredictable since the cahained link is broken. Most likely the application will crash.

    Franc

Children