eina_lock: do not set PTHREAD_MUTEX_ERRORCHECK on recursive locks

Summary:
a mutex can only have one type, so setting this type onto a recursive mutex
will unset the recursive attribute and cause deadlocks

ref T1984
@fix

Reviewers: stefan_schmidt, ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T1984

Differential Revision: https://phab.enlightenment.org/D6264
This commit is contained in:
Mike Blumenkrantz 2018-06-15 11:21:43 -04:00 committed by Chris Michael
parent 48dc758688
commit 1c52aede2b
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ _eina_lock_new(Eina_Lock *mutex, Eina_Bool recursive)
if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0) goto fail_release;
}
#ifdef EINA_HAVE_DEBUG_THREADS
if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0) goto fail_release;
else if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK) != 0) goto fail_release;
memset(mutex, 0, sizeof(Eina_Lock));
#endif
if (pthread_mutex_init(&(mutex->mutex), &attr) != 0) goto fail_release;