forked from enlightenment/efl
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:
parent
48dc758688
commit
1c52aede2b
|
@ -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;
|
if (pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0) goto fail_release;
|
||||||
}
|
}
|
||||||
#ifdef EINA_HAVE_DEBUG_THREADS
|
#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));
|
memset(mutex, 0, sizeof(Eina_Lock));
|
||||||
#endif
|
#endif
|
||||||
if (pthread_mutex_init(&(mutex->mutex), &attr) != 0) goto fail_release;
|
if (pthread_mutex_init(&(mutex->mutex), &attr) != 0) goto fail_release;
|
||||||
|
|
Loading…
Reference in New Issue