when pthread exits or is cancelled, mutexes held by thread are marked inconsistent and the highest priority thread waiting for the mutex is awakened.

This commit is contained in:
Gregory Nutt
2017-03-26 13:37:05 -06:00
parent 6e623ce06f
commit fe03ef02c4
5 changed files with 15 additions and 2 deletions
+4
View File
@@ -123,6 +123,10 @@ void pthread_exit(FAR void *exit_value)
exit(EXIT_FAILURE);
}
/* Recover any mutexes still held by the canceled thread */
pthread_mutex_inconsistent(tcb);
/* Perform common task termination logic. This will get called again later
* through logic kicked off by _exit(). However, we need to call it before
* calling _exit() in order certain operations if this is the last thread