From 79ad9eda7a235cfe7cfc74bcc1eb79e9d5df695d Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Wed, 29 Nov 2023 16:14:44 +0900 Subject: [PATCH] change wait_idle timeout from 200ms to 500ms - 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 --- src/tpl_utils_gthread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tpl_utils_gthread.c b/src/tpl_utils_gthread.c index b4b78cf..c744b5b 100644 --- a/src/tpl_utils_gthread.c +++ b/src/tpl_utils_gthread.c @@ -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(>hread->idle_cond, >hread->idle_mutex, -- 2.7.4