Commit Graph

59345 Commits

Author SHA1 Message Date
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 b455617500 ecore/thread: flush main loop threads during ecore_thread_wait()
this avoids the case where the main loop is waiting on a thread
and that same thread is waiting on the main loop

@fix

Differential Revision: https://phab.enlightenment.org/D6438
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 04d209e238 ecore/thread: flush main loop threads while waiting during shutdown
if a thread is actively waiting on the main loop in order to proceed
with its exit, a flush here avoids the case where the thread waits
until the main loop has exited

Differential Revision: https://phab.enlightenment.org/D6437
2018-06-28 18:08:45 +02:00
Mike Blumenkrantz 2ee83cc28d ecore/thread: increase loop iterations when waiting during shutdown
since this is now a smaller wait interval, looping more times helps
ensure success for threads which have longer blocking operations
between lifetime checks

Differential Revision: https://phab.enlightenment.org/D6436
2018-06-28 18:08:45 +02:00
Hosang Kim df652673fe evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().

Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`

#include <Evas.h>
#include <Ecore.h>

Eina_Bool
_timer_cb (void *data)
{
    ecore_main_loop_quit();
    return 0;
}
int
main(int argc, char *argv[])
{

   evas_init();
   Evas *evas = evas_new();
   Evas_Object *obj = evas_object_box_add(evas);
   Evas_Object *rect = evas_object_rectangle_add(evas);
   evas_object_color_set(rect, 255, 255, 255, 255);
   evas_object_resize(rect, 300, 400);
   evas_object_show(rect);

   evas_object_box_append(obj, rect);

   evas_object_show(obj);
   ecore_timer_add(2.0, _timer_cb, NULL);
   ecore_main_loop_begin();

   evas_shutdown();
   return 0;
}

Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 07:50:31 -04:00
Mike Blumenkrantz f23344733f eina/mempool: remove debug thread check to verify mempool deletion thread
Summary:
a common use case for mempools is that they get created by a thread but then
exist for the duration of the app's lifetime until shutdown() occurs in the
main thread. there is no reason to have an assert here which blocks that
use case
Depends on D6434

Reviewers: ManMower, bu5hm4n, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6435
2018-06-27 06:18:14 -04:00
Mike Blumenkrantz 3a3fcfb423 tests: ignore ibus module in ecore-imf tests when DISPLAY is not set
Summary:
ibus module will refuse to load if DISPLAY is not set, so avoid failing
for no reason in this case
Depends on D6433

Reviewers: ManMower, bu5hm4n, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6434
2018-06-27 06:18:00 -04:00
Mike Blumenkrantz 21bba131c8 tests: avoid cascading failure in ecore-imf tests when not forking
Summary:
these tests explicitly call ecore_imf_init, so they must call ecore_imf_shutdown
even on failure cases to avoid propagating their failure to subsequent tests

ref T7085

Reviewers: ManMower, bu5hm4n, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7085

Differential Revision: https://phab.enlightenment.org/D6433
2018-06-27 06:17:45 -04:00
Carsten Haitzler 194971342b eina debug - fix setuid process shutdown by initting fully except conn
init eina debug fully except for the debug daemon connection that the
setuid check was meant to skip. this fixes T7055
2018-06-27 14:13:00 +09:00
Mike Blumenkrantz 4aad39ce03 ecore-evas-x: set draw_block until the window receives a configure event (#2)
Summary:
drawing a non-override window before receiving a configure event results
in an unsized window, breaking spec. it also prevents ecore-evas resize
callbacks from triggering, yielding undefined returns from functions which
attempt to get the geometry of the ecore-evas

this patch improves upon the previous version by handling the case of windows
which are created with the correct initial size, bypassing an initial configure
event

there is still a lot of work to be done in this engine to improve/consolidate
resize-related code and ensure protocol correctness

ref T7008
fix T6907

Reviewers: devilhorns, ManMower

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7008, T6907

Differential Revision: https://phab.enlightenment.org/D6275
2018-06-27 13:49:57 +09:00
Carsten Haitzler cc726c011e Revert "elm win - fix resizing on show. rage was broken last week. this fixes it"
This reverts commit 7bf845b24c.
2018-06-27 13:49:57 +09:00
Derek Foreman 7d54989f9b ecore_drm2: Fix failure to properly set up new plane
Summary:
When we add a plane we need to add it to the list before doing the atomic
test to ensure we're testing new state that includes the plane, and to
ensure the next screen update includes the plane we just added.

Fix T7066

Reviewers: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7066

Differential Revision: https://phab.enlightenment.org/D6432
2018-06-26 15:28:07 -04:00
Xavi Artigas 80baf516a3 Revert "eina: provide full string length to vsnprintf to allow for null character"
Summary:
This reverts commit e0f8e65d20 which changed the
behavior of eina_stringshare_nprintf() and was not really needed to fix T6903.

Reviewers: zmike, Jaehyun_Cho, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6903

Differential Revision: https://phab.enlightenment.org/D6431
2018-06-26 12:38:22 -04:00
Marcel Hollerbach 5337d908e4 elm: register legacy_type correctly
Summary:
What happened before is that we registered efl_ui_leyout_legacy for
"elm_layout", which is not that good, since checking a (lets say) elm_button, for the type "elm_layout" would result in false. The same is with elm_button.

fixes T7081

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7081

Differential Revision: https://phab.enlightenment.org/D6430
2018-06-26 12:21:55 -04:00
Mike Blumenkrantz b0cb3b935a eina/threadqueue: use mempool_del for hash free function
Summary:
I typod this in 14ae3e3dec and when using
mempools other than chained, this probably caused all apps to crash on
shutdown

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6428
2018-06-25 17:55:25 -04:00
Mike Blumenkrantz 6eaa57852a ecore/thread: greatly reduce usleep time during shutdown loop
Summary:
now that ecore accurately waits on all threads while exiting, this
loop needs to run much more frequently in order to avoid waiting for
an unreasonably long time when exiting

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6427
2018-06-25 17:27:18 -04:00
Mike Blumenkrantz 1dc706a3dd ecore/thread: track "no_queue" threads
these threads are still managed by the main loop, meaning they must be
accounted for so that they can be waited on if necessary during shutdown

this resolves some issues where ecore-con threads would persist after the
main thread had exited or called ecore_shutdown

@fix
fix T7041

this is the final version of the patch and not the mangled version which
was previously committed

Differential Revision: https://phab.enlightenment.org/D6354
2018-06-25 16:54:24 -04:00
Mike Blumenkrantz 8d2f5d7a7d Revert "ecore/thread: track "no_queue" threads"
This reverts commit 1e47db6a71.

somehow arc managed to land an old revision of this which was not consistent
with the final version of D6354
2018-06-25 16:53:40 -04:00
Mike Blumenkrantz 32cebe903d tests: split a large failure case for eina_file tests to provide more info
Summary:
each failure case should always be separate in order to provide the highest
degree of detail available if a test fails

Reviewers: devilhorns, ManMower

Reviewed By: ManMower

Subscribers: ManMower, cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6373
2018-06-25 15:20:37 -04:00
Mike Blumenkrantz 83bab7cab4 eina/lock: add errno wrapping for backtrace() calls in thread debug blocks
Summary:
somehow backtrace() is able to generate EINVAL in certain cases even though
this is not documented anywhere. these irrelevant errors should not be noticed
by users of the api during debugging, as this can cause some tests/apps to
randomly fail without explanation

@fix

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6377
2018-06-25 15:20:37 -04:00
Mike Blumenkrantz 93228108ef elm/win: move trigger for "shot" to first pre-render callback
Summary:
in the case where the first render took far longer then the specified
shot interval, this would end up recording garbage since there was nothing
drawn yet

@fix
fix T6929

Reviewers: bu5hm4n, JackDanielZ, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6929

Differential Revision: https://phab.enlightenment.org/D6426
2018-06-25 15:20:27 -04:00
Mike Blumenkrantz 7bbf18a950 edje: return available text data in part_text_get without recalc when possible
Summary:
based on the codepaths taken when setting text to a part, a recalc should
only be necessary when returning markup from a textblock, and this is only
the case because the function returns a non-allocated string

in the case where the object is textblock and (legacy || not fetching markup),
the current text is guaranteed to be set on this pointer. the reason a
recalc is necessary for the markup case is because edje TEXTBLOCK parts only
set text to the internal textblock during a recalc, meaning that attempting
to fetch text on a just-set part will fail; this does not mean that the internal
textblock object doesn't exist, only that the text has not yet been set to it
Depends on D6422

Reviewers: herdsman, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6423
2018-06-25 15:19:33 -04:00
Mike Blumenkrantz 6839003510 edje: remove recalc during part_recursive_get
Summary:
this adds perf overhead in order to work around a bug in text_get

all part objects are instantiated during edje_object_file_set, and forcing
a recalc here does nothing more than perform unnecessary operations

ref 8f95b17f39
ref D6365

Reviewers: herdsman, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6422
2018-06-25 15:18:56 -04:00
Mike Blumenkrantz b3b104a1e7 eina/debug_cpu: rework thread usage
Summary:
this changes the explicit pthread usage (and reimplementation of eina_thread_create)
to just use eina function calls. it also causes the thread to start and stop when
profiling is enabled and resolves some possible errors which could occur after
a fork or when trying to compile under windows

pthread usage: this code appears to have been 100% copied from eina_thread.c, and it
isn't clear to me why existing eina_thread api was not used. this has no functional
benefit, but it makes the code more readable

thread lifetime: there is no need to have a thread running at all times for a feature
which will be rarely used and which must be explicitly enabled by the user

windows: this file previously generated a lot of compiler warnings from unused functions
and variables since nothing here is available under windows. the entire file is now
a giant #ifndef _WIN32 to avoid any compile warnings or unexpected runtime behavior

fix T7055
Depends on D6371

Reviewers: ManMower, vtorri, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7055

Differential Revision: https://phab.enlightenment.org/D6372
2018-06-25 15:17:14 -04:00
Mike Blumenkrantz 3562878e21 eina/debug: replace some explicit pthread_t usage with Eina_Thread
no functional changes

Differential Revision: https://phab.enlightenment.org/D6371
2018-06-25 15:17:14 -04:00
Mike Blumenkrantz bea602f258 evas/thread_render: improve thread safety
this resolves some invalid read/write operations between threads without locking
and also attempts to improve thread-related behavior after fork() calls

ref T7027

Differential Revision: https://phab.enlightenment.org/D6370
2018-06-25 15:17:14 -04:00
Mike Blumenkrantz aedaa7ed19 eina/lock: rework meaning of EINA_DEBUG_THREADS variable
Summary:
previously this used to mean 'the number of ms that a lock can wait for
until abort() is called once the lock is acquired' and it was useful
when trying to find contention issues with locks

unfortunately this required a bit of reading into the code to determine,
and it made the common case of setting values to 1 fail in some cases,
as this is a very short amount of time. also the documentation explicitly
gives '1' as an example setting for this variable, which will cause immediate
abort() in most cases when debugging was enabled since things are much slower

this variable now is the number of usec that a lock can wait for before abort()
is called, and the lowest value that will be checked for abort()ing is 100, meaning
that '1' is valid again
Depends on D6375

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6376
2018-06-25 15:15:34 -04:00
Mike Blumenkrantz 6b91b6a389 eina/lock: when debug threads are enabled, always call trylock in lock function
Summary:
when debugging thread issues, it's not actually helpful to immediately
deadlock--this defeats any attempt at debugging. instead, call trylock first
in order to detect a possible deadlock and then throw an error which can be
caught by the user
Depends on D6374

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6375
2018-06-25 15:15:32 -04:00
Mike Blumenkrantz 73ba4006bd eina/lock: reorder inline posix lock functions
Summary: no functional changes

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6374
2018-06-25 15:15:29 -04:00
YeongJong Lee a522bf5d76 ecore_evas: prevent duplicated ecore_evas registration
Summary:
After a44697c37a, we can register same ecore_evas
to ecore_evases using ecore_evas_input_event_register.
(ecore_evas_input_event_register -> ecore_evas_done -> _ecore_evas_register)
This can make infinite loop in EINA_INLIST_FOREACH(ecore_evases, ee) because
next inlist of ecore_evases is ecore_evases after double call of
_ecore_evas_register.

This patch prevent it.

Test Plan:
Ecore_Evas *ee = ecore_evas_new(NULL, 0, 0, 800, 600, NULL);
ecore_evas_input_event_register(ee);
(part of document of ecore_fb_input_device_window_set)

Check that there is no infinite loop

Reviewers: zmike, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6390
2018-06-25 15:14:31 -04:00
Mike Blumenkrantz 0e40fad446 ecore_con: make dns resolver thread stop blocking when canceled
Summary:
if the user or system attempts to cancel this thread then it should
stop blocking and exit in order to avoid potentially exiting after
efl has expected ecore-con to stop being active

@fix
fix T7041
Depends on D6354

Reviewers: ManMower, devilhorns

Reviewed By: ManMower

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7041

Differential Revision: https://phab.enlightenment.org/D6355
2018-06-25 15:14:31 -04:00
Mike Blumenkrantz 1e47db6a71 ecore/thread: track "no_queue" threads
these threads are still managed by the main loop, meaning they must be
accounted for so that they can be waited on if necessary during shutdown

this resolves some issues where ecore-con threads would persist after the
main thread had exited or called ecore_shutdown

@fix
fix T7041

Differential Revision: https://phab.enlightenment.org/D6354
2018-06-25 15:14:31 -04:00
Mike Blumenkrantz 14ae3e3dec eina_thread_queue: use normal mempools for block allocation
there's no need to reimplement mempools here when we already have a great
mempool api

this makes the code slightly more readable

Differential Revision: https://phab.enlightenment.org/D6353
2018-06-25 15:14:30 -04:00
Mike Blumenkrantz 198016d503 ecore: reformat ecore_thread.c
no functional changes

Differential Revision: https://phab.enlightenment.org/D6352
2018-06-25 15:14:30 -04:00
Mike Blumenkrantz 51d0faec67 eo: remove some erroneous mutex unlocks during base class parent_set errors
recent changes added unlocks for these mutexes in some other places, so only
do the unlocks where necessary

fix T7020
2018-06-25 15:14:30 -04:00
Mike Blumenkrantz f4a55e9266 tests: add coverage for efl_parent_set with invalidated parent object
this hits a codepath which was otherwise never triggered by unit tests
2018-06-25 15:14:30 -04:00
Chris Michael 392668bdfb edje_lua: Wrap calls to edje_object_part_object_get with freeze/thaw
Summary:
@ref T6884

Depends on D6419

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6420
2018-06-25 11:36:52 -04:00
Chris Michael eed3e5dfe9 efl_ui_layout_pack: Wrap calls to edje_object_part_object_get with
Summary:
freeze/thaw

@ref T6884

Depends on D6418

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6419
2018-06-25 11:36:52 -04:00
Chris Michael 580100d87d elm_clock: Wrap calls to edje_object_part_object_get with freeze/thaw
Summary:
@ref T6884

Depends on D6417

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6418
2018-06-25 11:36:52 -04:00
Chris Michael a1704700ac elm_calendar: Wrap calls to edje_object_part_object_get with freeze/thaw
Summary:
@ref T6884

Depends on D6416

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6417
2018-06-25 11:36:52 -04:00
Chris Michael 70b322b31b elc_popup: Wrap calls to edje_object_part_object_get with freeze/thaw
Summary:
@ref T6884

Depends on D6415

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6416
2018-06-25 11:36:51 -04:00
Chris Michael 42d97d0420 efl_ui_win: Wrap calls to edje_object_part_object_get with freeze/thaw
Summary:
@ref T6884

Depends on D6414

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6415
2018-06-25 11:36:51 -04:00
Chris Michael 7a7ab00955 elc_naviframe: Wrap calls to edje_object_part_object_get with
Summary:
freeze/thaw

@ref T6884

Depends on D6413

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6414
2018-06-25 11:36:51 -04:00
Chris Michael f7064f9500 elc_multibuttonentry: Wrap calls to edje_object_part_object_get with
Summary:
freeze/thaw

@ref T6884

Depends on D6412

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6413
2018-06-25 11:36:51 -04:00
Chris Michael 5a54a3d357 efl_ui_calendar: Wrap calls to edje_object_part_object_get with
Summary:
freeze/thaw

@ref T6884

Depends on D6411

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6412
2018-06-25 11:36:40 -04:00
Chris Michael c1f3cf2a47 elm_spinner: Wrap calls to edje_object_part_object_get with freeze/thaw
Summary:
@ref T6884

Depends on D6410

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6411
2018-06-25 11:32:47 -04:00