Commit Graph

175 Commits

Author SHA1 Message Date
Mike McCormack 01e790ed40 ecore: Create a lockless ecore_main_fd_handler_del
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 62374
2011-08-12 05:22:07 +00:00
Mike McCormack e1b75002f0 ecore: Avoid returning when holding locks
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 62347
2011-08-11 12:01:09 +00:00
Mike McCormack f05e37addf ecore: Create callback wrappers
This gets rid of a lot of temporary variables and cleans the code up again...

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 62342
2011-08-11 10:59:48 +00:00
Gustavo Lima Chaves 0603a5cf50 [ecore] Put order in header file, splitting function groups in contiguous chunks.
Sorry for having to pratically rewrite the header, but the other way
    to get docs right would be to put lots of @addtogroup around several
    chunks of the file, which is ugly too and doesn't organize anything.

    I have tested ecore with that and it seems to be okay.



SVN revision: 62307
2011-08-10 19:14:48 +00:00
Mike McCormack 5c8256e337 ecore: Add main loop thread safety
Thread safety is disabled by default.
Enable it with --enable-thread-safety

Should cover timers, events, animators, idlers and fd handlers.

Tested with Enlightenment and elementary_test.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61851
2011-07-28 12:01:16 +00:00
Mike McCormack 6f8f583abf ecore: Reduce rendering latency in g_main_loop
After a lot of hair pulling, and other debugging, it appears
that to make animation smooth on an embedded device, the
following things should happen in (quick) sequence:

1. update the loop time
2. call timers (which animates and updates the scene graph)
3. call idle enterers (which renders to the display)
4. call fd buf handlers (which flushes xlib stuff)

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61784
2011-07-27 03:13:47 +00:00
Mike McCormack 1fe297b463 ecore: Check timers when not idling also
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61782
2011-07-27 02:34:53 +00:00
Mike McCormack 6b57d19096 ecore: Enable timers in glib dispatch
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61286
2011-07-12 11:57:12 +00:00
Mike McCormack a55b6bb98e ecore: Make g_main_loop call idle enterers last
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61285
2011-07-12 11:57:03 +00:00
Mike McCormack dc537d0047 ecore: Run timers at end of glib loop
This reduces the time between calculating the scene
and rendering it, making scrolling smoother.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61284
2011-07-12 11:56:54 +00:00
Mike McCormack 540bf3368f ecore: Fix warnings when epoll is disabled
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61283
2011-07-12 11:56:45 +00:00
Mike McCormack c64f48b32a ecore: Only check timers if we need to
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61282
2011-07-12 11:56:36 +00:00
Mike McCormack 6052bbe9c1 ecore: Remove redundant variable
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61281
2011-07-12 11:56:24 +00:00
Mike McCormack 125f08ef40 ecore: Set source priority to high
Will only make a difference if there are other gsources.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61269
2011-07-12 06:11:23 +00:00
Mike McCormack 92723a2ee5 ecore: Wake main loop immediately on zero sleep
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61268
2011-07-12 06:11:14 +00:00
Mike McCormack 4ff69d688c ecore: Fix logic bug in g_main_loop
Want to use timerfd if either seconds or nanoseconds is non-zero.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61224
2011-07-11 02:51:37 +00:00
Mike McCormack f297fc260d ecore: Don't come out of idle because due to idlers
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61152
2011-07-08 10:26:24 +00:00
Mike McCormack cd493ac0b3 ecore: Check signals in glib prepare only
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61151
2011-07-08 10:26:14 +00:00
Mike McCormack 22719d5107 ecore: Check for pending before entering g_main_loop
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61150
2011-07-08 08:07:40 +00:00
Mike McCormack c69221de26 ecore: Only check timers on zero time left
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61149
2011-07-08 08:07:29 +00:00
Mike McCormack 8b02e5b6ab ecore: Remove redundant if statement
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61143
2011-07-08 06:38:18 +00:00
Mike McCormack f7f762154e ecore: Remove unnecessary debugging output
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61112
2011-07-07 11:37:12 +00:00
Mike McCormack 39c049c8d1 ecore: Make sure signals break from the main loop
SVN revision: 61111
2011-07-07 11:37:02 +00:00
Mike McCormack c94a9eff7f ecore: Remove most #ifdef HAVE_EPOLL blocks
Replace with if statements and stub epoll calls, and let the
compiler optimize out the stub code.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61081
2011-07-06 10:54:30 +00:00
Mike McCormack 829571df27 ecore: Remove most HAVE_TIMERFD_CREATE ifdefs
Introduce stub timerfd_create and timerfd_settime functions
so ifdefs can be removed.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61080
2011-07-06 10:54:20 +00:00
Mike McCormack 0ddf5b9cab ecore: Use timerfd with g_main_loop
glib only allows millisecond resolution in g_main_loop.
To avoid this limitation, use timerfd to wake up the main loop.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61079
2011-07-06 10:54:11 +00:00
Mike McCormack 2e00abb45f ecore: Only dispatch if we have something to do
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61042
2011-07-05 11:13:39 +00:00
Mike McCormack 7b1d7bd4a0 ecore: Add basic thread checks
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61041
2011-07-05 11:13:29 +00:00
Carsten Haitzler f7c9b4fa43 diable fix_hz - little need for that these days. i almost forgot that
this existed!



SVN revision: 61030
2011-07-05 04:08:01 +00:00
Mike McCormack a967e4f98a ecore: Sleep at least until the next timeout
The g_main_loop was spinning waiting for timers that were
almost ready.  The spinning was due to waking up from
the g_main_loop too early, and then having nothing to do.

To solve this, round the timeout up to the nearest millisecond,
so that when the main loop wakes, the timer will definitely be
ready.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61028
2011-07-05 02:32:07 +00:00
Mike McCormack d1691ffd70 ecore: Remove excessively verbose logging
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>

SVN revision: 61027
2011-07-05 02:31:58 +00:00
Rafael Antognolli 923ee3f2b9 ecore/fd_handler - Add detailed description to this group.
SVN revision: 61016
2011-07-04 18:31:23 +00:00
Rafael Antognolli 2cb63dce2a ecore - add and fix links to examples on each module description.
SVN revision: 61014
2011-07-04 18:31:02 +00:00
Carsten Haitzler bf448752f4 Fix epoll delete fd handling in child process - #796
SVN revision: 60895
2011-07-01 00:04:06 +00:00
Rafael Antognolli 5017f501ac ecore/fd_handler - Fix prepare_callback_set and improve its doc.
Now they can be set even if the list is empty (sorry discomfitor,
removing your optimization and making it O(n) again, back from O(0)).

Also notice that due to the already existing check, if a prepare
callback was already set to a fd handler, it can't be changed, so I
added that to the docs.



SVN revision: 60765
2011-06-28 15:05:09 +00:00
Carsten Haitzler 9bbe57e6e6 add ecore_throttle
SVN revision: 60756
2011-06-28 12:34:52 +00:00
Rafael Antognolli f5e4319b23 ecore/main_loop - Improve documentation of some functions.
SVN revision: 60597
2011-06-22 15:00:44 +00:00
Mike McCormack ad350741a0 ecore: Fix glib main loop busy waiting
SVN revision: 60253
2011-06-13 02:58:20 +00:00
Cedric BAIL 707f908ba1 ecore: add ecore_pipe_wait.
SVN revision: 60135
2011-06-09 14:54:24 +00:00
Carsten Haitzler a9a76f8012 thanks mike - g main loop build opt broken when removing too many loop
time gets



SVN revision: 59888
2011-06-02 06:08:59 +00:00
Daniel Juyung Seo b9eef78c41 Ecore ecore_main.c: Refactoring _ecore_main_loop_iterate_internal().
SVN revision: 59559
2011-05-21 05:24:27 +00:00
Daniel Juyung Seo b54f9c4022 Ecore ecore_main.c: Fixed ecore_main_loop(_ecore_main_loop_iterate_internal).
This fixes fd handler pending issue when ecore_idler callback adds ecore_job/event.


SVN revision: 59549
2011-05-20 06:35:07 +00:00
Carsten Haitzler 43ab3b8f56 optimization: don't need to get loop time so often in ecore main loop.
SVN revision: 59374
2011-05-14 03:26:28 +00:00
Vincent Torri 239dca689b Ecore: use isfinite() if available
Use isfinite() if available, otherwise use finite() on
compilers != vc++, otherwise use _finite()

and a bit of formatting too (i know, it's bad)


SVN revision: 58566
2011-04-11 19:58:56 +00:00
Vincent Torri 5c9f3ae378 Ecore:
Windows : change API (I allow myself that right for the win32 port :) )


SVN revision: 57724
2011-03-13 10:46:25 +00:00
Mike Blumenkrantz 0f1cd8b482 add more descriptive error messages for epoll flag mod failure
SVN revision: 57063
2011-02-15 19:51:06 +00:00
Mike McCormack 56b1e2dcc4 From: Mike McCormack <mj.mccormack@samsung.com>
Subject: [E-devel] [PATCH] ecore main loop "fd_handlers_to_call" list optimization
Date: Thu, 02 Dec 2010 15:22:13 +0900

Hi All,

Rather than using malloc'ed list entries in the mail loop, use a single linked in-place list.

This avoid lots of mallocs and frees as the main loop iterates.

thanks,

Mike


SVN revision: 56368
2011-01-29 05:34:00 +00:00
Vincent Torri f2c3d976f8 use typedef type for ecore_main_loop_select_func_get() API
SVN revision: 56261
2011-01-22 10:11:14 +00:00
Mike Blumenkrantz c8b8806b29 more descriptive error messages when epoll fails
@mike_m: should we replace this with strerror_r implementation?


SVN revision: 56247
2011-01-20 22:37:57 +00:00
Carsten Haitzler 6502ea96ea hve to revert these commits. they hve created a whole chunk of 64bit
crashes on linux. this is REALLY bad. so remove these changes now.



SVN revision: 55981
2011-01-07 15:56:54 +00:00