Add a checker whether pkgmgr thread is canceled or not 12/322512/2
authorVBS <sooyeon.kim@samsung.com>
Thu, 10 Apr 2025 07:49:16 +0000 (16:49 +0900)
committerVBS <sooyeon.kim@samsung.com>
Thu, 10 Apr 2025 07:50:04 +0000 (16:50 +0900)
- Issue:
There is a case that a second handle requests to cancel the pkgmgr thread, although the thread is pending to be canceled.

- Solution:
Before requesting to cancel the thread, we check whether the pkgmgr thread is pending to be canceled or not.

Change-Id: I9b94a6ad35fd11e34ee7488aeeceb0ad2eaed751
Signed-off-by: VBS <sooyeon.kim@samsung.com>
client/tts_core.c

index e105ddff1d08f4d1d6f4aa367f3797342b3653d8..e361761543f76f82541910c3f77d2cf0ea671e83 100644 (file)
@@ -797,7 +797,7 @@ int tts_core_deinitialize()
                g_unset_app_context_cb_idler = NULL;
        }
 
-       if (NULL != g_pkgmgr_thread) {
+       if (NULL != g_pkgmgr_thread && EINA_FALSE == ecore_thread_check(g_pkgmgr_thread)) {
                SLOG(LOG_INFO, TAG_TTSC, "[INFO] Cancel pkgmgr thread");
                ecore_thread_cancel(g_pkgmgr_thread);