1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00
* mutex.c (__pthread_mutex_unlock): For PTHREAD_MUTEX_RECURSIVE_NP
	test for owner first.
	Patch by Kaz Kylheku <kaz@ashi.footprints.net>.
This commit is contained in:
Ulrich Drepper
2000-09-28 23:11:33 +00:00
parent 8cab1d380a
commit c0ac34e447
18 changed files with 105 additions and 30 deletions

View File

@@ -163,6 +163,8 @@ int __pthread_mutex_unlock(pthread_mutex_t * mutex)
__pthread_unlock(&mutex->__m_lock);
return 0;
case PTHREAD_MUTEX_RECURSIVE_NP:
if (mutex->__m_owner != thread_self())
return EPERM;
if (mutex->__m_count > 0) {
mutex->__m_count--;
return 0;