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

What happens to mutexes and semaphores when a task is deleted

If I have a 2 tasks running that require the same semaphore (or mutex), and task 1 currently has control of it. Now there is a third task that deletes task 1 before task 1 has a chance to release the semaphore (or mutex). Does the os_tsk_delete function have the smarts to release it for me, or do I have to implement it?

Parents
  • Typically the OS cannot release the mutex. The task that owned it went away, it's not going to be known (to the OS) if the resource that it protected is in a consistent state.

    There is generally a better way to do things that avoids these types of things.

Reply
  • Typically the OS cannot release the mutex. The task that owned it went away, it's not going to be known (to the OS) if the resource that it protected is in a consistent state.

    There is generally a better way to do things that avoids these types of things.

Children
No data