https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/667
(cherry-picked from
2977211f5c3927ac9613688e37cc4cd06e44f1d6)
Change-Id: Ie7dd756317d1cab004861c7b85aa9822e94b4b0d
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
{
u_arraylist_t* threads_list;
oc_mutex list_lock;
{
u_arraylist_t* threads_list;
oc_mutex list_lock;
} ca_thread_pool_details_t;
/**
} ca_thread_pool_details_t;
/**
+ (*thread_pool)->details->isFree = false;
+
OIC_LOG(DEBUG, TAG, "OUT");
return CA_STATUS_OK;
OIC_LOG(DEBUG, TAG, "OUT");
return CA_STATUS_OK;
return CA_STATUS_FAILED;
}
return CA_STATUS_FAILED;
}
+ if(thread_pool->details->isFree){
+ OIC_LOG(INFO, TAG, "thread pool tasks already freed");
+ return CA_STATUS_OK;
+ }
+
oc_mutex_lock(thread_pool->details->list_lock);
for (uint32_t i = 0; i < u_arraylist_length(thread_pool->details->threads_list); ++i)
{
oc_mutex_lock(thread_pool->details->list_lock);
for (uint32_t i = 0; i < u_arraylist_length(thread_pool->details->threads_list); ++i)
{
oc_mutex_lock(thread_pool->details->list_lock);
oc_mutex_lock(thread_pool->details->list_lock);
+ thread_pool->details->isFree = true;
+
for (uint32_t i = 0; i < u_arraylist_length(thread_pool->details->threads_list); ++i)
{
ca_thread_pool_thread_info_t *threadInfo = (ca_thread_pool_thread_info_t *)
for (uint32_t i = 0; i < u_arraylist_length(thread_pool->details->threads_list); ++i)
{
ca_thread_pool_thread_info_t *threadInfo = (ca_thread_pool_thread_info_t *)