- If there was an error when processing tdm_client_handle_events(),
tdm_source would have been destroyed before the process terminated.
- In this case, when Main thread terminate its twe_thread,
main thread will have to wait for the tdm_source destroy signal.
Change-Id: If2a8afb8dc801e5313e33298d9b320d4976e1480
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
{
twe_tdm_source *tdm_source = (twe_tdm_source *)source;
+ g_mutex_lock(&_twe_ctx->thread_mutex);
+
if (!tdm_source || g_source_is_destroyed(&tdm_source->gsource)) {
TPL_ERR("TDM source(%p) already destroyed.", tdm_source);
+ g_cond_signal(&_twe_ctx->thread_cond);
+ g_mutex_unlock(&_twe_ctx->thread_mutex);
return;
}
- g_mutex_lock(&_twe_ctx->thread_mutex);
-
g_source_remove_unix_fd(&tdm_source->gsource, tdm_source->tag);
g_source_destroy(&tdm_source->gsource);
g_source_unref(&tdm_source->gsource);