+ oc_mutex_unlock(thread->threadMutex);
+
+ return CA_STATUS_OK;
+}
+
+CAResult_t CAQueueingThreadClearContextData(CAQueueingThread_t *thread,
+ CAContextDataDestroy callback, void *ctx)
+{
+ if (NULL == thread)
+ {
+ OIC_LOG(ERROR, TAG, "thread instance is empty..");
+ return CA_STATUS_INVALID_PARAM;
+ }
+
+ if (NULL == callback)
+ {
+ OIC_LOG(ERROR, TAG, "callback is NULL..");
+ return CA_STATUS_INVALID_PARAM;
+ }
+
+ if (NULL == ctx)
+ {
+ OIC_LOG(ERROR, TAG, "ctx is NULL..");
+ return CA_STATUS_INVALID_PARAM;
+ }
+
+ OIC_LOG(DEBUG, TAG, "Clear thread data according to context");
+
+ // mutex lock
+ oc_mutex_lock(thread->threadMutex);
+
+ // remove adapter related list data.
+ u_queue_remove_req_elements(thread->dataQueue, callback, ctx, thread->destroy);
+
+ // mutex unlock
+ oc_mutex_unlock(thread->threadMutex);