diff options
authorMike Blumenkrantz <zmike@samsung.com>2018-06-25 15:15:34 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-06-25 15:15:34 -0400
commitaedaa7ed1994182e15018999a29a215ac2b4648f (patch)
parenteina/lock: when debug threads are enabled, always call trylock in lock function (diff)
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 https://phab.enlightenment.org/D6375 Reviewers: ManMower, devilhorns Reviewed By: ManMower Subscribers: cedric, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D6376
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/eina/eina_inline_lock_posix.x b/src/lib/eina/eina_inline_lock_posix.x
index bbcd97be86..625441accf 100644
--- a/src/lib/eina/eina_inline_lock_posix.x
+++ b/src/lib/eina/eina_inline_lock_posix.x
@@ -254,7 +254,7 @@ eina_lock_take(Eina_Lock *mutex)
- 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);
dt -= t0.tv_usec - t1.tv_usec;
- dt /= 1000;
if (dt > _eina_threads_debug) abort();