From: Wanlong G. <gao...@cn...> - 2013-07-10 14:45:39
|
POSIX said: (Sure it is unclear) The pthread_mutex_lock() function shall fail if: [EDEADLK] The mutex type is PTHREAD_MUTEX_ERRORCHECK and the current thread already owns the mutex. The pthread_mutex_trylock() function shall fail if: [EBUSY] The mutex could not be acquired because it was already locked. So we should allow pthread_mutex_trylock return EDEADLK or EBUSY when the mutex is already owned. Signed-off-by: Wanlong Gao <gao...@cn...> --- .../conformance/interfaces/pthread_mutex_trylock/4-3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c index 64c549d..8e75239 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c @@ -274,7 +274,8 @@ void *test(void *arg) } ret = EBUSY; } - if (ret != EBUSY) { + + if (ret != EBUSY && ret != EDEADLK) { UNRESOLVED(ret, "Unexpected error was returned."); } -- 1.8.3.2.634.g7a3187e |