Commit Graph

246 Commits

Author SHA1 Message Date
Mike Blumenkrantz 9f8a7acfcf eio/sentry: destroy event handlers when deleting sentry
this will crash due to invalid memory access if an event is triggered after
the sentry is destroyed

Differential Revision: https://phab.enlightenment.org/D6845
2018-08-17 22:19:32 +02:00
Marcel Hollerbach c77ba1672e eio: fix poll backend
it seems that this should have been a pop call, not the function
pointer. This key eina_array_pop is never used. Nor would the array get
smaller, so i assume this should be a pop call.

Differential Revision: https://phab.enlightenment.org/D6814
2018-08-12 14:25:09 +02:00
Derek Foreman 35210b553d eio_model: Fix deleting files that don't have assigned types yet
Summary:
Trying to delete a file from a creation notification callback can
fail.  Sometimes the eio model test would sit forever in select()
waiting for events that will never occur because of this.

This happens since d84a268a71 broke
deleting of files that haven't yet been assigned a type.  Before
this commit a delete_me flag would be set before attempting to
build a stat buf asynchronously, and then on completion the file
would be deleted.

I think this was changed because that could potentially race with
other async calls and delete the file sooner than expected.  So
instead of reverting I've made a special delete path that shouldn't
race with non-delete paths.

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6543
2018-07-10 09:43:55 -04:00
Mike Blumenkrantz ddc31e75ac eio/fallback: avoid emitting monitor events if the backend is pending deletion
emitting events if the delete_me flag is set may result in events being emitted
for an already-freed monitor, resulting in both invalid memory access and a
deadlock later on if eio_shutdown has been called at this point

this causes the monitoring thread to check the status of the backend during the
block where the main loop and thread are in sync, avoiding any data races which
could occur when checking the flag at another time, and also avoiding accessing
the internals of the Ecore_Thread which could also have been deallocated during
shutdown

fix T7086

Differential Revision: https://phab.enlightenment.org/D6449
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 7ed4b407e7 eio: add method for determining if a monitor is using the fallback mechanism
the fallback method of calling stat() on the monitored paths does not allow
for various eio events to be emitted, meaning that any application which relies
on those events can never receive them

this provides a method for checking a monitor to determine which functionality
is available, and also provides more explicit documentation regarding events
that are not provided by fallback monitoring

this method is marked as beta

@feature

Differential Revision: https://phab.enlightenment.org/D6447
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 65afddf2ae eio/fallback: do not modify the children hash while iterating it
this is invalid use of the hash api and will cause a crash

@fix

Differential Revision: https://phab.enlightenment.org/D6444
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz f41b9ea204 eio/fallback: mark all fallback monitors as fallbacks, not just for win32
@fix

Differential Revision: https://phab.enlightenment.org/D6443
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 1544ec4808 eio/fallback: fix MODIFY event emission on base path when monitoring
previously this sent a DELETE event any time the target file was modified

@fix
fix T7042

Differential Revision: https://phab.enlightenment.org/D6442
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 062f6cabdd eio/fallback: remove intermediate idler
for some reason, the fallback thread would exit -> create timer ->
create idler -> create thread; the existence of the idler makes little
sense and introduces variability in the timer interval

@fix

Differential Revision: https://phab.enlightenment.org/D6441
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 1b18a4e679 eio/fallback: fix fallback shutdown when threads exist
threads should not be waited on here during shutdown since these same
threads may be waiting on the main loop anyway

instead, perform as much deallocation as possible,
mark the monitor as deleted, and then set the thread to canceled and
allow the thread to clean itself up during its cancel/end callback

@fix

Differential Revision: https://phab.enlightenment.org/D6440
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 4987fd4ab8 eio/fallback: always create timer hash on fallback init
this is a required call in order for the fallback system to work

Differential Revision: https://phab.enlightenment.org/D6439
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 2acb5e506a eio: add method for setting the global file polling rate for fallback monitors
Summary:
the default value for the fallback poll monitor timer interval is 60.0 seconds,
which is not useful for all cases, such as CI, where we don't care about cpu
usage and just want things to process as fast as possible at all times

this enables setting the interval to any value, ensuring that any existing
timers are modified to use that value immediately

@feature

Reviewers: stefan_schmidt, bu5hm4n, raster, devilhorns, ManMower

Reviewed By: bu5hm4n, ManMower

Subscribers: ManMower, raster, bu5hm4n, cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6247
2018-06-19 13:33:14 -04:00
Larry Lira 1fb268ac3c Eio: fix eio_model children_slice_get all 2018-06-07 19:15:50 -03:00
Cedric BAIL 901eeb94e3 eio: enforce eio model to have a parent that provide main loop access. 2018-05-24 16:02:21 -07:00
Daniel Kolesa 577c00789a eolian: second batch of unused import removals
This fixes all remaining occurences introduced by false negatives
in 6bcd70f01d. The rest was already
fixed in 6be3809c04.
2018-05-13 18:13:12 +02:00
Cedric BAIL e8df3515d7 eio: on error/cancel properly destroy weak reference. 2018-05-05 21:15:55 -07:00
Cedric BAIL 382079bccd eio: cancel idler on Eio.Model destruction properly. 2018-05-05 21:15:24 -07:00
Cedric BAIL d84a268a71 eio: do not call efl_model_child_del at the end of build_st as that might result in the destruction of files. 2018-05-04 16:23:01 -07:00
Daniel Kolesa f58bdbf23a eolian: switch Eina.Future instances to future<T> 2018-05-03 17:14:39 +02:00
Cedric Bail c3072e77e6 eio: prevent asynchronous destruction of object while thread is still running. 2018-05-02 10:46:34 -07:00
Mike Blumenkrantz f1d411db2f eio: fix windows build
Summary: S_ISSOCK does not exist because sockets do not exist

Reviewers: vtorri, cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D6035
2018-05-02 12:26:24 -04:00
Cedric BAIL a34a733b7b eio: remove last remnant of Efl_Promise. 2018-05-01 10:39:01 -07:00
Cedric BAIL 8e107c991c efl: update Efl.Model to properly propagate EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED. 2018-05-01 10:39:01 -07:00
Cedric BAIL 8f17ab22ac eio: handle future cancellation properly for Efl.Io.Manager. 2018-05-01 10:39:01 -07:00
Cedric Bail 4a54ae0b0a eio: migrate to the new efl.model API. 2018-04-30 14:21:12 -07:00
Cedric BAIL bba8fbe449 eio: improve efl.io.manager API by being const when not touching the object. 2018-04-30 14:21:12 -07:00
Cedric Bail 202f433476 eio: remove unecessary helper function Efl.Io.Manager. 2018-04-30 14:21:12 -07:00
Cedric Bail 9882a28736 eio: fix efl_io_manager_stat after conversion to Eina_Future. 2018-04-30 14:21:12 -07:00
Cedric Bail 6de16678b9 eio: convert efl_io_manager_stat_ls to use Eina_Future. 2018-04-30 14:21:12 -07:00
Cedric Bail 51776fb94a eio: convert efl_io_manager_direct_ls to Eina_Future. 2018-04-30 14:21:12 -07:00
Cedric Bail da45eb54a8 eio: switch Efl.Io.Manager to actually use Array instead of Accessor (to avoid unecessary callback). 2018-04-30 14:21:12 -07:00
Cedric BAIL 44dceade11 eio: share _efl_io_manager_future_cancel with all of eio. 2018-04-30 14:21:12 -07:00
Cedric BAIL afb18198bb eio: allow access to Eina_Value Eina_Stat description from all part of the library. 2018-04-30 14:21:12 -07:00
Xavi Artigas 23c303f87b Efl.Loop_* (from Efl.Loop.*)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:04:03 -07:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Carsten Haitzler 2fb5cc3ad0 efl_add_ref - fis to use efl_add properly with a parent.
fixes bc18b7e7ad and
168849e8a0
2018-03-29 13:30:55 +09:00
Cedric BAIL 4c4177ac20 efl: use efl_add_ref to create objects which have no parent
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:56 -07:00
Carsten Haitzler 1c74aaa7e9 Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303b.

Revert "efl: move signal events from efl.loop to efl.app"
This reverts commit 3dbca39f98.

Revert "efl: add test suite for efl_app"
This reverts commit 3e94be5d73.

Revert "efl: create Efl.App class, the parent of Efl.Loop"
This reverts commit 28fe00b94e.

Go back to before efl.app because I think this should be done with
superclassing here not a parent object. reasons?

1. multiple loops per single thread make no sense. so if multilpe loop
objects they wont be contained in a single app object and then deleted
like this.
2. the app object is not really sharable in this design so it cant be
accessed from other threads
3. it makes it harder to get the main loop or app object (well 2 func
calls one calling the other and more typing. it is longer to type and
more work where it is not necessary, and again it can't work from
other threads unless we go duplicating efl.app per thread and then
what is the point of splittyign out the signal events from efl.loop
then?)

etc.
2018-03-03 13:40:33 +09:00
Al Poole 34a25f0318 eio_file: fix some indentation.
Make this easier to read.
2018-02-27 17:33:47 +00:00
Mike Blumenkrantz e22a0ab4c7 eio: move some typedefs into base eio header
eio eo api uses these. FIXME?
2018-02-26 14:46:35 -05:00
Mike Blumenkrantz 28fe00b94e efl: create Efl.App class, the parent of Efl.Loop 2018-02-26 14:02:51 -05:00
Mike Blumenkrantz 5025569f77 eio: sentry.del -> sentry.remove 2018-02-15 13:11:00 -05:00
Mike Blumenkrantz adc2be188c eolian: convert all of cedric's tabs to spaces in .eo files 2018-02-12 12:59:05 -05:00
Mike Blumenkrantz d55fc77cfa eio: remove broken pid-based monitor reset copied from ecore-file
this has no technical basis for existing and should be handled by
individual monitor backends

@fix
2018-02-07 12:12:22 -05:00
Mike Blumenkrantz 26d73cbae1 eio: make inotify monitors fork-safe
@fix
2018-02-02 16:59:44 -05:00
Vincent Torri 8f5029fbbc Eio: disable the symlink code on Windows 2018-01-30 16:52:24 +09:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
Daniel Kolesa dd11d19653 efl: make efl build again
After a function pointer validation branch got enabled, it turned
out that people have been writing obviously incorrect eo files
all along.

So while I have no idea if this is logically fully correct, at
least EFL builds again now...

cc @thiepha
2018-01-12 19:31:45 +01:00
Cedric Bail 23624acc16 eio: remove unecessary include. 2018-01-11 21:30:39 -08:00
Cedric BAIL 526415d903 eo: make efl_provider_find a @const function. 2018-01-04 11:45:10 -08:00