eina: disable abort on shutdown when triggered by system monitoring thread

Summary:
this lock/thread never gets destroyed, so it should not trigger failure cases
when that is always the case

@fix

Depends on D6266

Reviewers: stefan_schmidt, ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6267
This commit is contained in:
Mike Blumenkrantz 2018-06-15 15:38:33 -04:00
parent 66bfc5ff4b
commit 8ef0cd0950
2 changed files with 16 additions and 12 deletions

View File

@ -35,7 +35,7 @@ volatile int _eina_debug_sysmon_reset = 0;
volatile int _eina_debug_sysmon_active = 0;
volatile int _eina_debug_evlog_active = 0;
static Eina_Lock _sysmon_lock;
Eina_Lock _sysmon_lock;
static Eina_Bool _sysmon_thread_runs = EINA_FALSE;
static pthread_t _sysmon_thread;

View File

@ -113,6 +113,7 @@ static int _mt_enabled = 0;
EAPI int _eina_threads_debug = 0;
EAPI pthread_mutex_t _eina_tracking_lock;
EAPI Eina_Inlist *_eina_tracking = NULL;
extern Eina_Lock _sysmon_lock;
#endif
/* place module init/shutdown functions here to avoid other modules
@ -395,17 +396,20 @@ eina_threads_shutdown(void)
pthread_mutex_lock(&_eina_tracking_lock);
if (_eina_tracking)
{
fprintf(stderr, "*************************\n");
fprintf(stderr, "* The IMPOSSIBLE HAPPEN *\n");
fprintf(stderr, "* LOCK STILL TAKEN : *\n");
fprintf(stderr, "*************************\n");
EINA_INLIST_FOREACH(_eina_tracking, lk)
{
fprintf(stderr, "=======\n");
eina_lock_debug(lk);
}
fprintf(stderr, "*************************\n");
abort();
if (((Eina_Lock*)_eina_tracking != (&_sysmon_lock)) || (_eina_tracking->next))
{
fprintf(stderr, "*************************\n");
fprintf(stderr, "* The IMPOSSIBLE HAPPEN *\n");
fprintf(stderr, "* LOCK STILL TAKEN : *\n");
fprintf(stderr, "*************************\n");
EINA_INLIST_FOREACH(_eina_tracking, lk)
{
fprintf(stderr, "=======\n");
eina_lock_debug(lk);
}
fprintf(stderr, "*************************\n");
abort();
}
}
pthread_mutex_unlock(&_eina_tracking_lock);
#endif