pthread: add more robustness characteristics
authorEunBong Song <eunb.song@samsung.com>
Thu, 13 Apr 2017 00:40:57 +0000 (09:40 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 18 Apr 2017 03:02:19 +0000 (12:02 +0900)
commit80d99a3e840cf30240056359f4f3f6e3c8f66030
tree6808a09737a51dc01142853f0ee82a7ccdee1537
parente22bf659f3578837d9c33de9e69fddd09e800ddf
pthread: add more robustness characteristics

pthread_mutex_lock() and trylock() will now return EOWNERDEAD if the
mutex is locked by a thread that no longer exists. Add
pthread_mutex_consistent() to recover from this situation. All credits
should go to Gregory Nutt who wrote the original commit.

Change-Id: Ife6319f6806e37cfba57a04992505b754b1712d3
Signed-off-by: Gregory Nutt <gnutt@nuttx.org>
[Song: backported 363403fb from NuttX]
Signed-off-by: EunBong Song <eunb.song@samsung.com>
os/include/errno.h
os/include/pthread.h
os/kernel/pthread/Make.defs
os/kernel/pthread/pthread_mutexconsistent.c [new file with mode: 0644]
os/kernel/pthread/pthread_mutexdestroy.c
os/kernel/pthread/pthread_mutexlock.c
os/kernel/pthread/pthread_mutextrylock.c
os/kernel/pthread/pthread_mutexunlock.c