ecore: fix usage eina_condition_timedwait to use relative time instead of absolute...
authorCedric BAIL <cedric@osg.samsung.com>
Wed, 14 Oct 2015 17:57:53 +0000 (10:57 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Wed, 14 Oct 2015 18:03:21 +0000 (11:03 -0700)
This could lead to some very long and unexpected pause as the timeout passed
to eina_condition_timedwait was passed as a absolute time instead of relative.
Hopefully we don't build rocket.

src/lib/ecore/ecore_thread.c

index f1aa613..befb0fb 100644 (file)
@@ -1398,7 +1398,7 @@ ecore_thread_global_data_wait(const char *key,
         if ((ret) || (!seconds) || ((seconds > 0) && (tm <= ecore_time_get())))
           break;
         LKL(_ecore_thread_global_hash_mutex);
-        CDW(_ecore_thread_global_hash_cond, tm);
+        CDW(_ecore_thread_global_hash_cond, tm - ecore_time_get());
         LKU(_ecore_thread_global_hash_mutex);
      }
    if (ret) return ret->data;