For pthread_mutex_trylock() call on owned error-check or non-portable
adaptive mutex, return EDEADLK as required by POSIX. The pthread_mutex_lock() is already compliant. Tested by: Guy Yur <guyyur@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb)
This commit is contained in:
parent
e6b22eb42a
commit
75248c1348
@ -850,9 +850,12 @@ mutex_self_trylock(struct pthread_mutex *m)
|
||||
|
||||
switch (PMUTEX_TYPE(m->m_flags)) {
|
||||
case PTHREAD_MUTEX_ERRORCHECK:
|
||||
case PTHREAD_MUTEX_NORMAL:
|
||||
case PTHREAD_MUTEX_ADAPTIVE_NP:
|
||||
ret = EBUSY;
|
||||
ret = EDEADLK;
|
||||
break;
|
||||
|
||||
case PTHREAD_MUTEX_NORMAL:
|
||||
ret = EBUSY;
|
||||
break;
|
||||
|
||||
case PTHREAD_MUTEX_RECURSIVE:
|
||||
|
Loading…
Reference in New Issue
Block a user