discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=aedaa7ed1994182e15018999a29a215ac2b4648f

commit aedaa7ed1994182e15018999a29a215ac2b4648f
Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Jun 25 15:15:34 2018 -0400

    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
---
 src/lib/eina/eina_inline_lock_posix.x | 3 +--
 1 file changed, 1 insertion(+), 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)
 #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();
      }

-- 


Reply via email to