Change-Id: I493b57bd93096fe433cd6db521563cacd8d47a3c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
return source->data;
}
+tpl_bool_t
+tpl_gsource_check_io_condition(tpl_gsource *source)
+{
+ GIOCondition cond;
+
+ if (!source) {
+ TPL_ERR("Invalid parameter tpl_gsource is null");
+ return TPL_FALSE;
+ }
+
+ cond = g_source_query_unix_fd(source->gsource, source->tag);
+ if (cond & G_IO_IN)
+ return TPL_TRUE;
+
+ return TPL_FALSE;
+}
+
void
tpl_gmutex_init(tpl_gmutex *gmutex)
{
tpl_gsource_get_data(tpl_gsource *source);
/**
+ * Check the GIOCondition of fd that tpl_gsource has
+ *
+ * @param source Pointer to tpl_gsource to check io condition.
+ * @return TPL_TRUE if GIOCondition is G_IO_IN, TPL_FALSE otherwise (G_IO_ERR).
+ */
+tpl_bool_t
+tpl_gsource_check_io_condition(tpl_gsource *source);
+
+/**
* wrapping g_mutex_init()
*
* @param gmutex Pointer to tpl_gmutex.