change wait_idle timeout from 200ms to 500ms 95/301995/3
authorJoonbum Ko <joonbum.ko@samsung.com>
Wed, 29 Nov 2023 07:14:44 +0000 (16:14 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Wed, 29 Nov 2023 07:54:59 +0000 (16:54 +0900)
 - There are often cases where scheduling is not received
  for more than 200ms in unexpectable situations such as cpu contension.
 - Since wait_idle is called in parts where synchronization is absolutely necessary,
  it is necessary to minimize the problem by increasing it to 500ms.

Change-Id: I2844a5700f12a77668df526ce65bd5d6f486b56a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_utils_gthread.c

index b4b78cf..c744b5b 100644 (file)
@@ -502,6 +502,8 @@ _thread_idle_cb(gpointer data)
        return G_SOURCE_REMOVE;
 }
 
+#define WAIT_IDLE_TIMEOUT 500
+
 tpl_result_t
 tpl_gthread_wait_idle(tpl_gthread *gthread)
 {
@@ -531,7 +533,7 @@ tpl_gthread_wait_idle(tpl_gthread *gthread)
 
        /* 200ms timeout */
        end_time = g_get_monotonic_time() +
-                               (200 * G_TIME_SPAN_MILLISECOND);
+                               (WAIT_IDLE_TIMEOUT * G_TIME_SPAN_MILLISECOND);
        do {
                ret = g_cond_wait_until(&gthread->idle_cond,
                                                                &gthread->idle_mutex,