From 1064464ef9918fd39c4f3edc775b5cd849b0cd22 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Thu, 10 Nov 2022 18:00:21 +0900 Subject: [PATCH] Add cancel callback feedback thread - Issue: Sometimes, ecore_thread_cancel() is blocked in vc_mgr_stop_feedback(). - Solution: In vc_mgr_stop_feedback(), ecore_thread_cancel() is used, but the cancel callback is not set. Thus, this patch adds cancel callback and makes the callback reset the thread variable. Through this patch, the thread variable will be safely reset. Change-Id: I926c52aec385b07da65dbf1f6b363eeec328acdd Signed-off-by: Suyeon Hwang --- client/vc_mgr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/vc_mgr.c b/client/vc_mgr.c index 0de3b92..cdb0a25 100644 --- a/client/vc_mgr.c +++ b/client/vc_mgr.c @@ -3488,6 +3488,12 @@ static void __end_tts_feedback_thread(void* data, Ecore_Thread* thread) g_feedback_thread = NULL; } +static void __cancel_tts_feedback_thread(void* data, Ecore_Thread* thread) +{ + SLOG(LOG_INFO, TAG_VCM, "[SUCCESS] Cancel thread"); + g_feedback_thread = NULL; +} + int vc_mgr_start_feedback(void) { SLOG(LOG_INFO, TAG_VCM, "@@@ [Manager] start feedback"); @@ -3512,7 +3518,7 @@ int vc_mgr_start_feedback(void) bool is_exist = ecore_thread_check(g_feedback_thread); if (NULL == g_feedback_thread || TRUE == is_exist) { SLOG(LOG_INFO, TAG_VCM, "[INFO] ecore thread run : __tts_feedback_thread"); - g_feedback_thread = ecore_thread_run(__tts_feedback_thread, __end_tts_feedback_thread, NULL, NULL); + g_feedback_thread = ecore_thread_run(__tts_feedback_thread, __end_tts_feedback_thread, __cancel_tts_feedback_thread, NULL); } #else /* start playing TTS feedback */ -- 2.34.1