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,8 +850,11 @@ 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 = EDEADLK;
|
||||
break;
|
||||
|
||||
case PTHREAD_MUTEX_NORMAL:
|
||||
ret = EBUSY;
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user