static Eina_Bool __tts_notify_error(void *data);
int __tts_cb_error(int uid, tts_error_e reason, int utt_id, char* err_msg);
int __tts_recheck_screen_reader();
+static void __start_reprepare_thread(void* data, Ecore_Thread* thread);
+static void __end_reprepare_thread(void* data, Ecore_Thread* thread);
static const char* tts_tag()
{
/* check whether engine is updating or not */
if (g_engine_update_status) {
SLOG(LOG_ERROR, TAG_TTSC, "[DEBUG] cannot prepare due to engine update");
- __tts_cb_error(-1, TTS_ERROR_SERVICE_RESET, -1, "Daemon Reset");
-
+ if (NULL == client->thread) {
+ SLOG(LOG_INFO, TAG_TTSC, "[INFO] ecore thread run: start_reprepare_thread");
+ client->thread = ecore_thread_run(__start_reprepare_thread, __end_reprepare_thread, NULL, tts);
+ }
return EINA_FALSE;
}
}
/* If engine is NOT launched, check whether engine is updating or not */
if (g_engine_update_status) {
SLOG(LOG_ERROR, TAG_TTSC, "[DEBUG] cannot prepare due to engine update");
- __tts_cb_error(-1, TTS_ERROR_SERVICE_RESET, -1, "Daemon Reset");
+ if (NULL == client->thread) {
+ SLOG(LOG_INFO, TAG_TTSC, "[INFO] ecore thread run: start_reprepare_thread");
+ client->thread = ecore_thread_run(__start_reprepare_thread, __end_reprepare_thread, NULL, tts);
+ }
client->hello_timer = NULL;
return EINA_FALSE;
}
client->hello_timer = ecore_timer_add(0.5, __send_hello, tts);
return EINA_FALSE;
}
+
return EINA_TRUE;
}
static void __end_reprepare_thread(void* data, Ecore_Thread* thread)
{
SLOG(LOG_INFO, TAG_TTSC, "[INFO] end reprepare thread");
+
+ tts_h tts = (tts_h)data;
+ tts_client_s* client = tts_client_get(tts);
+ /* check handle */
+ if (NULL == client) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] client is null");
+ return;
+ }
+ client->thread = NULL;
}
int __tts_cb_error(int uid, tts_error_e reason, int utt_id, char* err_msg)
data->current_state = TTS_STATE_CREATED;
data->reason = 0;
- ecore_thread_run(__start_reprepare_thread, __end_reprepare_thread, NULL, data);
+ if (NULL == data->thread) {
+ SLOG(LOG_INFO, TAG_TTSC, "[INFO] ecore thread run: start_reprepare_thread");
+ data->thread = ecore_thread_run(__start_reprepare_thread, __end_reprepare_thread, NULL, data->tts);
+ }
}
/* Next item */
client->current_state = TTS_STATE_CREATED;
client->reason = 0;
- ecore_thread_run(__start_reprepare_thread, __end_reprepare_thread, NULL, client);
+ if (NULL == client->thread) {
+ SLOG(LOG_INFO, TAG_TTSC, "[INFO] ecore thread run: start_reprepare_thread");
+ client->thread = ecore_thread_run(__start_reprepare_thread, __end_reprepare_thread, NULL, client->tts);
+ }
}
}