Fix hanging on pthread_cond_destroy during cancellation of thread by broadcasting... 89/220889/1 accepted/tizen/unified/20191227.142807 submit/tizen/20191226.105621
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:55:53 +0000 (17:55 +0900)
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 5fd84f1..e936f8f 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 42990af..886e70d 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);