- OIC_LOG_V(ERROR, TAG, "Thread start failed with error %d", result);
+ // Note that this is considered non-fatal.
+ oc_mutex_unlock(thread_pool->details->list_lock);
+ OIC_LOG(ERROR, TAG, "Arraylist add failed");
+ OICFree(info);
+ OICFree(threadInfo);
+ return CA_STATUS_FAILED;
+ }
+
+#ifndef __TIZENRT__
+ int thrRet = oc_thread_new(&threadInfo->thread, ca_thread_pool_pthreads_delegate, info);
+#else
+ int thrRet = oc_thread_new(&threadInfo->thread, ca_thread_pool_pthreads_delegate, info,
+ task_name, stack_size);
+#endif
+ if (thrRet != 0)
+ {
+ uint32_t index = 0;
+ if (u_arraylist_get_index(thread_pool->details->threads_list, threadInfo, &index))
+ {
+ u_arraylist_remove(thread_pool->details->threads_list, index);
+ }
+ oc_mutex_unlock(thread_pool->details->list_lock);
+ OIC_LOG_V(ERROR, TAG, "Thread start failed with error %d", thrRet);
+ OICFree(info);