From dfb9c585b164b31fc47def07d4ebafa59cf1e4e9 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Mon, 26 Jul 2010 04:20:18 +0000 Subject: [PATCH] add typedefs for ecore thread function types because I'm tired of typing them out git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@50499 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore/Ecore.h | 27 ++++++++++++++++----------- src/lib/ecore/ecore_thread.c | 21 ++++++++++----------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h index 3fd5a8f..0856789 100644 --- a/src/lib/ecore/Ecore.h +++ b/src/lib/ecore/Ecore.h @@ -167,6 +167,13 @@ extern "C" { typedef struct _Ecore_Exe_Event_Data_Line Ecore_Exe_Event_Data_Line; /**< Lines from a child process */ typedef struct _Ecore_Exe_Event_Data Ecore_Exe_Event_Data; /**< Data from a child process */ typedef struct _Ecore_Thread Ecore_Thread; + typedef void (*Ecore_Thread_Func_Blocking) (void *data); + typedef void (*Ecore_Thread_Func_End) (void *data); + typedef void (*Ecore_Thread_Func_Cancel) (void *data); + typedef void (*Ecore_Thread_Func_Heavy) (Ecore_Thread *thread, void *data); + typedef void (*Ecore_Thread_Func_Notify) (Ecore_Thread *thread, void *msg_data, void *data); + + typedef struct _Ecore_Job Ecore_Job; /**< A job handle */ @@ -335,18 +342,16 @@ extern "C" { EAPI void ecore_pipe_write_close(Ecore_Pipe *p); EAPI void ecore_pipe_read_close(Ecore_Pipe *p); - EAPI Ecore_Thread *ecore_thread_run(void (*func_blocking)(void *data), - void (*func_end)(void *data), - void (*func_cancel)(void *data), + EAPI Ecore_Thread *ecore_thread_run(Ecore_Thread_Func_Blocking, + Ecore_Thread_Func_End, + Ecore_Thread_Func_Cancel, const void *data); - EAPI Ecore_Thread *ecore_long_run(void (*func_heavy)(Ecore_Thread *thread, - void *data), - void (*func_notify)(Ecore_Thread *thread, - void *msg_data, void *data), - void (*func_end)(void *data), - void (*func_cancel)(void *data), - const void *data, - Eina_Bool try_no_queue); + EAPI Ecore_Thread *ecore_long_run(Ecore_Thread_Func_Heavy, + Ecore_Thread_Func_Notify, + Ecore_Thread_Func_End, + Ecore_Thread_Func_Cancel, + const void *data, + Eina_Bool try_no_queue); EAPI Eina_Bool ecore_thread_cancel(Ecore_Thread *thread); EAPI Eina_Bool ecore_thread_check(Ecore_Thread *thread); EAPI Eina_Bool ecore_thread_notify(Ecore_Thread *thread, const void *msg_data); diff --git a/src/lib/ecore/ecore_thread.c b/src/lib/ecore/ecore_thread.c index ca89397..5c1d4bd 100644 --- a/src/lib/ecore/ecore_thread.c +++ b/src/lib/ecore/ecore_thread.c @@ -374,10 +374,10 @@ _ecore_thread_shutdown(void) * host CPU can handle. */ EAPI Ecore_Thread * -ecore_thread_run(void (*func_blocking)(void *data), - void (*func_end)(void *data), - void (*func_cancel)(void *data), - const void *data) +ecore_thread_run(Ecore_Thread_Func_Blocking, + Ecore_Thread_Func_End, + Ecore_Thread_Func_Cancel, + const void *data) { #ifdef EFL_HAVE_PTHREAD Ecore_Pthread_Worker *work; @@ -543,13 +543,12 @@ ecore_thread_check(Ecore_Thread *thread) * the CPU down, so be carefull with that. Of course if it can't start a new thread, it will * try to use one from the pool. */ -EAPI Ecore_Thread * -ecore_long_run(void (*func_heavy)(Ecore_Thread *thread, void *data), - void (*func_notify)(Ecore_Thread *thread, void *msg_data, void *data), - void (*func_end)(void *data), - void (*func_cancel)(void *data), - const void *data, - Eina_Bool try_no_queue) +EAPI Ecore_Thread *ecore_long_run(Ecore_Thread_Func_Heavy, + Ecore_Thread_Func_Notify, + Ecore_Thread_Func_End, + Ecore_Thread_Func_Cancel, + const void *data, + Eina_Bool try_no_queue) { #ifdef EFL_HAVE_PTHREAD -- 2.7.4