- In the twe thread, the event fd being poll must be
woken up only with G_IO_IN.
- However, if some problem occurs in fd, it can wake up with
G_IO_ERR, G_IO_HUP, G_IO_NVAL, and try dispatch.
In this case, it is difficult to predict the situation after G_SOURCE_REMOVE,
so ASSERT should be used to find the time when the problem occurs.
- If there is no ASSERT () or remove, g_main_loop will repeatedly
wake up and try to dispatch the source, causing a problem of making CPU usage high.
Change-Id: I678119c192c7ab52acd11965e54dfa9a890fa8e7
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
if (del_source->destroy_target_source_func)
del_source->destroy_target_source_func(del_source->target_source);
+ } else {
+ TPL_ERR("eventfd(%d) cannot wake up with other condition. cond(%d)",
+ del_source->event_fd, cond);
+ TPL_ASSERT((cond & G_IO_IN));
}
return G_SOURCE_CONTINUE;
} else {
_twe_thread_wl_surface_acquire_and_commit(surf_source);
}
+ } else {
+ TPL_ERR("eventfd(%d) cannot wake up with other condition. cond(%d)",
+ surf_source->event_fd, cond);
+ TPL_ASSERT((cond & G_IO_IN));
}
return G_SOURCE_CONTINUE;