ecore event_loop: add the error handler for event_loop 38/192738/2
authorlsj119 <lsj119@samsung.com>
Fri, 9 Nov 2018 01:49:18 +0000 (10:49 +0900)
committerSangjin Lee <lsj119@samsung.com>
Tue, 13 Nov 2018 03:05:48 +0000 (03:05 +0000)
When the return value of select is ZERO, _ecore_main_fdh_mark_active did not called.
So in _ecore_main_awake_handler, we cannot guarantee right operation. For this problem,
Even the return valie of select is ZERO, call the _ecore_main_fdh_mark_active()
with NULL parameters. and In _ecore_main_fdh_mark_active(), reset the all flags for each
fd_handlers.

Change-Id: I6f47f6ce9f824a21e668c099d1601243b3af8b53

src/lib/ecore/ecore_glib.c
src/lib/ecore/ecore_main.c

index 06ba14e..d0d4004 100644 (file)
@@ -201,6 +201,8 @@ _ecore_glib_select__locked(GMainContext   *ctx,
     */
    if (ret > 0)
      _ecore_main_fdh_mark_active(rfds, wfds, efds);
+   else
+     _ecore_main_fdh_mark_active(NULL, NULL, NULL);
 
    /* Once exit from select(), _ecore_main_awake_handler_call() should be called here
     * to call wl_display_cancel_read() or wl_display_read_events().
index 8b96dc6..5101115 100644 (file)
@@ -614,8 +614,25 @@ _ecore_main_fdh_mark_active(fd_set *rfds, fd_set *wfds, fd_set *exfds)
    Eo *obj = ML_OBJ;
    Efl_Loop_Data *pd = ML_DAT;
 
-#ifdef HAVE_EPOLL
+   if (!rfds && !wfds && !exfds)       //That mean by return value of select is 0
+     {
+        EINA_INLIST_FOREACH(pd->fd_handlers, fdh)
+          {
+             if (!fdh->delete_me)
+               {
+                  if (fdh->read_active || fdh->write_active || fdh->error_active)
+                    ERR("Invalid mark active(fd:%d, read:%d, write:%d, err:%d) ", fdh->fd, fdh->read_active, fdh->write_active, fdh->error_active);
 
+                  fdh->read_active = EINA_FALSE;
+                  fdh->write_active = EINA_FALSE;
+                  fdh->error_active = EINA_FALSE;
+               }
+          }
+
+        return 0;
+     }
+
+#ifdef HAVE_EPOLL
    if (HAVE_EPOLL && pd->epoll_fd >= 0)
      ret = _ecore_main_fdh_epoll_mark_active(obj, pd);
    else