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?
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.