static vc_audio_type_e g_feedback_audio_type = 0;
static Ecore_Thread* g_feedback_thread = NULL;
+static Ecore_Thread* g_mgr_thread = NULL;
+
static Eina_Bool __vc_mgr_notify_state_changed(void *data);
static void __vc_mgr_notify_error(void *data);
static Eina_Bool __vc_mgr_notify_result(void *data);
static void __end_prepare_thread(void *data, Ecore_Thread *thread)
{
SLOG(LOG_INFO, TAG_VCM, "@@@ End prepare thread");
+ g_mgr_thread = NULL;
}
int vc_mgr_prepare(void)
return VC_ERROR_INVALID_STATE;
}
- ecore_thread_main_loop_begin();
- ecore_thread_run(__start_prepare_thread, __end_prepare_thread, NULL, NULL);
- ecore_thread_main_loop_end();
+ bool is_exist = ecore_thread_check(g_mgr_thread);
+ if (NULL == g_mgr_thread || TRUE == is_exist) {
+ SLOG(LOG_DEBUG, TAG_VCM, "[DEBUG] Create a new thread for preparation");
+ ecore_thread_main_loop_begin();
+ g_mgr_thread = ecore_thread_run(__start_prepare_thread, __end_prepare_thread, NULL, NULL);
+ ecore_thread_main_loop_end();
+ }
SLOG(LOG_DEBUG, TAG_VCM, "@@@");
}
#if 1
- bool is_canceled = ecore_thread_check(g_feedback_thread);
- if (NULL == g_feedback_thread || TRUE == is_canceled) {
+ 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);
}