{
FN_CALL;
int ret;
- iotcon_response_result_e response_result;
+ GSource *idle_src;
iotcon_options_h options;
- icl_response_container_s *cb_container = ctx;
iotcon_response_h response;
iotcon_representation_h repr;
icl_response_cb_s *response_cb_data;
+ iotcon_response_result_e response_result;
+ icl_response_container_s *cb_container = ctx;
RETV_IF(NULL == ctx, OC_STACK_DELETE_TRANSACTION);
RETV_IF(NULL == resp, OC_STACK_DELETE_TRANSACTION);
return OC_STACK_DELETE_TRANSACTION;
}
- g_idle_add(_icl_ioty_ocprocess_crud_idle_cb, response_cb_data);
+ idle_src = g_idle_source_new();
+ g_source_set_priority(idle_src, G_PRIORITY_DEFAULT);
+ g_source_set_callback(idle_src, _icl_ioty_ocprocess_crud_idle_cb, response_cb_data,
+ NULL);
+ g_source_attach(idle_src, cb_container->thread_context);
+ g_source_unref(idle_src);
/* DO NOT FREE ctx(cb_container). It MUST be freed in the ocstack */
/* DO NOT FREE cb_data. It MUST be freed in the idle */
}
icl_remote_resource_unref(cb_container->resource);
+ g_main_context_unref(cb_container->thread_context);
+
free(cb_container);
}
cb_container->req_type = req_type;
cb_container->cb = cb;
cb_container->user_data = user_data;
+ cb_container->thread_context = g_main_context_ref_thread_default();
cbdata.context = cb_container;
cbdata.cb = icl_ioty_ocprocess_crud_cb;
#define __IOT_CONNECTIVITY_LIBRARY_TYPES_H__
#include <stdint.h>
+#include <glib.h>
#include "iotcon-types.h"
#include "icl-ioty.h"
int timeout;
iotcon_remote_resource_h resource;
iotcon_request_type_e req_type;
+ GMainContext *thread_context;
} icl_response_container_s;
typedef struct {