Cedric, could please:
1) move the detection of pthread.h in the part "### Checks for header
files"
2) move the inclusion of Eina.h in Ecore.h before the definition of EAPI
(otherwise, the build on Windows will fail)
3) line 120 of ecore_thread.c, put __UNUSED__ after data
?
btw, why did you include Evil.h in ecore_thread.c ? Also, shouldn't
ecore_thread_init() and ecore_thread_shutdown() do things only if pthred
is available ? (it's useless to add events in that case, imho. I think of
Win CE which does not have pthread, to save some memory)
thank you
Vincent
On Fri, 31 Jul 2009, Enlightenment SVN wrote:
Log:
* ecore_thread_run: Add a facility to run heavy code in another thread
that still integrate cleanly with the EFL.
ecore_thread_run need two callbacks :
* func_heavy is called from another thread and should not use the
EFL except Eina, but carefully.
* func_end is called when func_heavy is done, but from inside ecore
main loop, so you can at this point call every EFL functions without
fear.
Note :
The system automatically detect how many CPU you have and will spread
the load on all of them.
You must not assume that the result will come in the same order you
requested it. Depend on each CPU load and how heavy the function on it
are.
Author: cedric
Date: 2009-07-31 10:06:11 -0700 (Fri, 31 Jul 2009)
New Revision: 41555
Added:
trunk/ecore/src/lib/ecore/ecore_thread.c
Modified:
trunk/ecore/configure.ac trunk/ecore/src/lib/ecore/Ecore.h
trunk/ecore/src/lib/ecore/Makefile.am trunk/ecore/src/lib/ecore/ecore.c
trunk/ecore/src/lib/ecore/ecore_private.h
Modified: trunk/ecore/configure.ac
===================================================================
--- trunk/ecore/configure.ac 2009-07-31 15:30:15 UTC (rev 41554)
+++ trunk/ecore/configure.ac 2009-07-31 17:06:11 UTC (rev 41555)
@@ -197,6 +197,12 @@
requirements_ecore_win32=""
requirements_ecore_wince=""
+# basic pthread support
+AC_CHECK_HEADER(pthread.h,
+ [
+ AC_DEFINE(BUILD_PTHREAD, 1, [Build thread worker])
+ ]
+)
### Additional options to configure
Modified: trunk/ecore/src/lib/ecore/Ecore.h
===================================================================
--- trunk/ecore/src/lib/ecore/Ecore.h 2009-07-31 15:30:15 UTC (rev 41554)
+++ trunk/ecore/src/lib/ecore/Ecore.h 2009-07-31 17:06:11 UTC (rev 41555)
@@ -59,6 +59,8 @@
# include <signal.h>
#endif
+#include <Eina.h>
+
#ifndef TRUE
# define TRUE 1
#endif
@@ -300,6 +302,8 @@
EAPI void ecore_pipe_write_close(Ecore_Pipe *p);
EAPI void ecore_pipe_read_close(Ecore_Pipe *p);
+ EAPI Eina_Bool ecore_thread_run(void (*func_heavy)(void *data), void
(*func_end)(void *data), const void *data);
+
EAPI double ecore_time_get(void);
EAPI double ecore_loop_time_get(void);
Modified: trunk/ecore/src/lib/ecore/Makefile.am
===================================================================
--- trunk/ecore/src/lib/ecore/Makefile.am 2009-07-31 15:30:15 UTC (rev
41554)
+++ trunk/ecore/src/lib/ecore/Makefile.am 2009-07-31 17:06:11 UTC (rev
41555)
@@ -34,7 +34,8 @@
ecore_time.c \
ecore_timer.c \
ecore_tree.c \
-ecore_value.c
+ecore_value.c \
+ecore_thread.c
libecore_la_LIBADD = @dlopen_libs@ @EINA_LIBS@ @EVIL_LIBS@ @WIN32_LIBS@ -lm
libecore_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info
@version_info@ @ecore_release_info@
Modified: trunk/ecore/src/lib/ecore/ecore.c
===================================================================
--- trunk/ecore/src/lib/ecore/ecore.c 2009-07-31 15:30:15 UTC (rev 41554)
+++ trunk/ecore/src/lib/ecore/ecore.c 2009-07-31 17:06:11 UTC (rev 41555)
@@ -89,6 +89,7 @@
if (_ecore_fps_debug) _ecore_fps_debug_init();
_ecore_signal_init();
_ecore_exe_init();
+ ecore_thread_init();
_ecore_loop_time = ecore_time_get();
}
@@ -114,6 +115,7 @@
if (_ecore_fps_debug) _ecore_fps_debug_shutdown();
_ecore_poller_shutdown();
_ecore_animator_shutdown();
+ ecore_thread_shutdown();
_ecore_exe_shutdown();
_ecore_idle_enterer_shutdown();
_ecore_idle_exiter_shutdown();
Modified: trunk/ecore/src/lib/ecore/ecore_private.h
===================================================================
--- trunk/ecore/src/lib/ecore/ecore_private.h 2009-07-31 15:30:15 UTC (rev
41554)
+++ trunk/ecore/src/lib/ecore/ecore_private.h 2009-07-31 17:06:11 UTC (rev
41555)
@@ -444,8 +444,9 @@
void _ecore_fps_debug_shutdown(void);
void _ecore_fps_debug_runtime_add(double t);
+int ecore_thread_init(void);
+int ecore_thread_shutdown(void);
-
extern int _ecore_fps_debug;
extern double _ecore_loop_time;
Added: trunk/ecore/src/lib/ecore/ecore_thread.c
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
--
Ce message a été vérifié par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a été trouvé.
Message délivré par le serveur de messagerie de l'Université d'Evry.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel