eina/lock: rework meaning of EINA_DEBUG_THREADS variable

Summary:
previously this used to mean 'the number of ms that a lock can wait for
until abort() is called once the lock is acquired' and it was useful
when trying to find contention issues with locks

unfortunately this required a bit of reading into the code to determine,
and it made the common case of setting values to 1 fail in some cases,
as this is a very short amount of time. also the documentation explicitly
gives '1' as an example setting for this variable, which will cause immediate
abort() in most cases when debugging was enabled since things are much slower

this variable now is the number of usec that a lock can wait for before abort()
is called, and the lowest value that will be checked for abort()ing is 100, meaning
that '1' is valid again
Depends on D6375

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6376
This commit is contained in:
Mike Blumenkrantz 2018-06-25 15:15:34 -04:00
parent 6b91b6a389
commit aedaa7ed19
1 changed files with 1 additions and 2 deletions

View File

@ -254,7 +254,7 @@ eina_lock_take(Eina_Lock *mutex)
#endif
#ifdef EINA_HAVE_DEBUG_THREADS
if (_eina_threads_debug)
if (_eina_threads_debug >= 100)
{
struct timeval t0, t1;
int dt;
@ -268,7 +268,6 @@ eina_lock_take(Eina_Lock *mutex)
dt += (t1.tv_usec - t0.tv_usec);
else
dt -= t0.tv_usec - t1.tv_usec;
dt /= 1000;
if (dt > _eina_threads_debug) abort();
}