Fix hanging on pthread_cond_destroy during cancellation of thread by broadcasting... 90/220890/1 tizen_5.5_tv accepted/tizen/5.5/unified/20191230.212347 submit/tizen_5.5/20191226.105636
authorSeungbae Shin <seungbae.shin@samsung.com>
Tue, 24 Dec 2019 08:55:53 +0000 (17:55 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Tue, 24 Dec 2019 08:57:37 +0000 (08:57 +0000)
References:
  https://stackoverflow.com/questions/44736601/strange-behavior-of-pthread-cond-destroy-hanging
  https://stackoverflow.com/questions/20439404/pthread-conditions-and-process-termination

[Version] 0.0.19
[Issue Type] Bug

Change-Id: I49f2c64d33a39dc01f3018e174ddc891ce664fb5

packaging/capi-media-sound-pool.spec
src/stream_cb_manager.c

index 5fd84f11192c85c4bce75106376de9fc9a0b78fb..e936f8f9e57e291c44da65db676a993fc860b9eb 100644 (file)
@@ -1,5 +1,5 @@
 Name:       capi-media-sound-pool
-Version:    0.0.18
+Version:    0.0.19
 Summary:    Tizen Sound Pool module
 Release:    0
 Group:      Multimedia/Framework
index 42990af315b8c0e4ded1e5f472a72e2da83082db..886e70d1e61d30e4f34dfbcf46dded7d45f79069 100644 (file)
@@ -41,8 +41,10 @@ static void __thread_cancel_cleanup(void *user_data)
 
        stream_cb_manager_t *cbmgr = (stream_cb_manager_t *)user_data;
        g_async_queue_unref(cbmgr->isolator_callback_queue);
-       pthread_mutex_destroy(&cbmgr->isolator_data_mutex);
+
+       pthread_cond_broadcast(&cbmgr->isolator_data_cond);
        pthread_cond_destroy(&cbmgr->isolator_data_cond);
+       pthread_mutex_destroy(&cbmgr->isolator_data_mutex);
 
        SP_SAFE_GFREE(cbmgr);