+ OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
+ return CA_STATUS_OK;
+}
+
+CAResult_t ca_thread_pool_remove_task(ca_thread_pool_t thread_pool, uint32_t taskId)
+{
+ OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
+
+ if (!thread_pool)
+ {
+ OIC_LOG(ERROR, TAG, "Invalid parameter thread_pool was NULL");
+ return CA_STATUS_FAILED;
+ }
+
+ oc_mutex_lock(thread_pool->details->list_lock);
+ 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 *)
+ u_arraylist_get(thread_pool->details->threads_list, i);
+ if (threadInfo)
+ {
+ if (threadInfo->taskId == taskId)
+ {
+ OIC_LOG_V(INFO, TAG, "waiting.. thread: %p, taskId: %u", threadInfo->thread,
+ threadInfo->taskId);
+ oc_thread_wait(threadInfo->thread);
+
+ OIC_LOG_V(INFO, TAG, "removed.. thread: %p, taskId: %u", threadInfo->thread,
+ threadInfo->taskId);
+ u_arraylist_remove(thread_pool->details->threads_list, i);
+ oc_thread_free(threadInfo->thread);
+ OICFree(threadInfo);
+ break;
+ }
+ }
+ }
+ oc_mutex_unlock(thread_pool->details->list_lock);
+
+ OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);