summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
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)
tree4862d40515a2a4505b27624224c2a1e1a5b6651b /src/lib/eina
parent6b91b6a38984a0638d37eb025fc75a3796878d06 (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 D6375 Reviewers: ManMower, devilhorns Reviewed By: ManMower Subscribers: cedric, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D6376
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_inline_lock_posix.x3
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)
254#endif 254#endif
255 255
256#ifdef EINA_HAVE_DEBUG_THREADS 256#ifdef EINA_HAVE_DEBUG_THREADS
257 if (_eina_threads_debug) 257 if (_eina_threads_debug >= 100)
258 { 258 {
259 struct timeval t0, t1; 259 struct timeval t0, t1;
260 int dt; 260 int dt;
@@ -268,7 +268,6 @@ eina_lock_take(Eina_Lock *mutex)
268 dt += (t1.tv_usec - t0.tv_usec); 268 dt += (t1.tv_usec - t0.tv_usec);
269 else 269 else
270 dt -= t0.tv_usec - t1.tv_usec; 270 dt -= t0.tv_usec - t1.tv_usec;
271 dt /= 1000;
272 271
273 if (dt > _eina_threads_debug) abort(); 272 if (dt > _eina_threads_debug) abort();
274 } 273 }