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

How delete semaphore

Hi,

I use event manager and define semaphore according to https://docs.zephyrproject.org/latest/reference/kernel/synchronization/semaphores.html.
How can i delete the semaphore at runtime and define new one?
Thanks

Parents
  • Hello,

    I don't think there is any API to delete a semaphore. If you want to do this, you will need to add this functionality to the semaphore implementation, but if you do this, it means that you need to change some zephyr files, which means you will need to do this again every time you update the SDK, which is not ideal.

    Why do you need to delete it and define a new one? Is the new one equal to the old one? If so, perhaps you can just use k_sem_reset() instead?

    Best regards,

    Edvin

  • The ne is not equals to old.
    I found that cmsis v2  lib can add and delete semaphore, what do you think?

Reply Children
No Data
Related