efl_io_model: next try to fix this race condition
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Wed, 18 Sep 2019 09:32:08 +0000 (11:32 +0200)
committerJongmin Lee <jm105.lee@samsung.com>
Fri, 20 Sep 2019 21:20:40 +0000 (06:20 +0900)
commit095ed35fc239f1a2a572c65a9e80fac65bc03c98
tree39e7b97e9c7cc59e81546664a01067abcca318f1
parent3429ef7b8398f346c1c50ef8fd4c7c59c0e0c57a
efl_io_model: next try to fix this race condition

what is happening is that a file gets announced through eio_model
listing code, at this point of time, the monitor does not yet know about
the file. If the file now gets deleted between the annoncing and the
learning of the file from the monitor, then the file got an ADD event,
but no DEL event. Which is a bug.

With this commit there is a new API which asks the monitor if the file
already has the knowledge about the files existance, or not. A few
monitors like win32 inotify or cocoa do not have context about the file
directly, if the OS is now having the same bug, then we are again in
trouble, however, we canot do anything about that. In the case of kevent
or poll, this asks the context of the monitor if the file is already
there.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10006
src/lib/eio/Eio_Legacy.h
src/lib/eio/efl_io_model.c
src/lib/eio/eio_monitor.c
src/lib/eio/eio_monitor_cocoa.c
src/lib/eio/eio_monitor_inotify.c
src/lib/eio/eio_monitor_kevent.c
src/lib/eio/eio_monitor_poll.c
src/lib/eio/eio_monitor_win32.c
src/lib/eio/eio_private.h