forked from enlightenment/efl
eina_lock: remove locks from eina tracking list on free while thread debugging
Summary: this prevents invalid memory access during subsequent inlist operations @fix sq Depends on D6265 Reviewers: stefan_schmidt, ManMower, devilhorns Reviewed By: ManMower Subscribers: cedric, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D6266
This commit is contained in:
parent
fb534b328e
commit
66bfc5ff4b
|
@ -179,6 +179,15 @@ eina_lock_recursive_new(Eina_Lock *mutex)
|
||||||
static inline void
|
static inline void
|
||||||
eina_lock_free(Eina_Lock *mutex)
|
eina_lock_free(Eina_Lock *mutex)
|
||||||
{
|
{
|
||||||
|
#ifdef EINA_HAVE_DEBUG_THREADS
|
||||||
|
if (mutex->locked)
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(&_eina_tracking_lock);
|
||||||
|
_eina_tracking = eina_inlist_remove(_eina_tracking,
|
||||||
|
EINA_INLIST_GET(mutex));
|
||||||
|
pthread_mutex_unlock(&_eina_tracking_lock);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
_eina_lock_free(mutex);
|
_eina_lock_free(mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue