From: Seungbae Shin Date: Tue, 24 Dec 2019 08:55:53 +0000 (+0900) Subject: Fix hanging on pthread_cond_destroy during cancellation of thread by broadcasting... X-Git-Tag: submit/tizen_5.5/20191226.105636^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df7c3d83243148e8f4620e589ad2975fab7dccd6;p=platform%2Fcore%2Fapi%2Fsound-pool.git Fix hanging on pthread_cond_destroy during cancellation of thread by broadcasting before destroy. 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 --- diff --git a/packaging/capi-media-sound-pool.spec b/packaging/capi-media-sound-pool.spec index 5fd84f1..e936f8f 100644 --- a/packaging/capi-media-sound-pool.spec +++ b/packaging/capi-media-sound-pool.spec @@ -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 diff --git a/src/stream_cb_manager.c b/src/stream_cb_manager.c index 42990af..886e70d 100644 --- a/src/stream_cb_manager.c +++ b/src/stream_cb_manager.c @@ -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);