From: Suyeon Hwang Date: Thu, 10 Nov 2022 09:00:21 +0000 (+0900) Subject: Add cancel callback feedback thread X-Git-Tag: submit/tizen/20230313.042534~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1064464ef9918fd39c4f3edc775b5cd849b0cd22;p=platform%2Fcore%2Fuifw%2Fvoice-control.git 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 --- 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 */