pthread: backport pthread mutex related patches
This patch backports several commits from NuttX, that fixes pthread
mutex issues. Applying only one patch causes compilation errors. So
these patches are submitted in a single commit. All credits should go to
Gregory Nutt who wrote the original commits.
Change-Id: I5dfb4f68a253228fa55335dd6dd4e4413c690f45
Signed-off-by: Gregory Nutt <gnutt@nuttx.org>
[Song: backported
a1fbc2ad,
2c37d369,
6e623ce0,
fe03ef02,
5a69453e,
34c5e1c1,
8b23c16b,
86ab384d and
8b3c554e. from NuttX]
Signed-off-by: EunBong Song <eunb.song@samsung.com>