diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2012-10-19 10:56:34 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2012-10-19 10:56:34 +0000 |
commit | 10f9d3a21567bde6927d3a9d710cfe53526419ad (patch) | |
tree | 29b0169e917dc5e8b3ffe009c3bda6617f53777e /legacy | |
parent | d84053ccfe811f4ef979d0e87ef33b378b1afa0b (diff) |
evas: move to Eina_Thread.
SVN revision: 78245
Diffstat (limited to 'legacy')
-rw-r--r-- | legacy/evas/src/lib/cache/evas_preload.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/legacy/evas/src/lib/cache/evas_preload.c b/legacy/evas/src/lib/cache/evas_preload.c index 6909d5c9f6..a9c79f3d97 100644 --- a/legacy/evas/src/lib/cache/evas_preload.c +++ b/legacy/evas/src/lib/cache/evas_preload.c | |||
@@ -4,7 +4,6 @@ | |||
4 | #ifdef HAVE_EVIL | 4 | #ifdef HAVE_EVIL |
5 | # include <Evil.h> | 5 | # include <Evil.h> |
6 | #endif | 6 | #endif |
7 | #include <pthread.h> | ||
8 | #ifdef __linux__ | 7 | #ifdef __linux__ |
9 | # include <sys/syscall.h> | 8 | # include <sys/syscall.h> |
10 | #endif | 9 | #endif |
@@ -32,7 +31,7 @@ struct _Evas_Preload_Pthread_Worker | |||
32 | 31 | ||
33 | struct _Evas_Preload_Pthread_Data | 32 | struct _Evas_Preload_Pthread_Data |
34 | { | 33 | { |
35 | pthread_t thread; | 34 | Eina_Thread thread; |
36 | }; | 35 | }; |
37 | 36 | ||
38 | static int _threads_count = 0; | 37 | static int _threads_count = 0; |
@@ -46,7 +45,7 @@ _evas_preload_thread_end(void *data) | |||
46 | Evas_Preload_Pthread_Data *pth = data; | 45 | Evas_Preload_Pthread_Data *pth = data; |
47 | Evas_Preload_Pthread_Data *p = NULL; | 46 | Evas_Preload_Pthread_Data *p = NULL; |
48 | 47 | ||
49 | if (pthread_join(pth->thread, (void **)&p) == 0) free(p); | 48 | if ((p = eina_thread_join(pth->thread))) free(p); |
50 | else return; | 49 | else return; |
51 | eina_threads_shutdown(); | 50 | eina_threads_shutdown(); |
52 | } | 51 | } |
@@ -66,14 +65,11 @@ _evas_preload_thread_done(void *target __UNUSED__, Evas_Callback_Type type __UNU | |||
66 | } | 65 | } |
67 | 66 | ||
68 | static void * | 67 | static void * |
69 | _evas_preload_thread_worker(void *data) | 68 | _evas_preload_thread_worker(void *data, Eina_Thread thread __UNUSED__) |
70 | { | 69 | { |
71 | Evas_Preload_Pthread_Data *pth = data; | 70 | Evas_Preload_Pthread_Data *pth = data; |
72 | Evas_Preload_Pthread_Worker *work; | 71 | Evas_Preload_Pthread_Worker *work; |
73 | 72 | ||
74 | eina_sched_prio_drop(); | ||
75 | pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); | ||
76 | pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); | ||
77 | on_error: | 73 | on_error: |
78 | for (;;) | 74 | for (;;) |
79 | { | 75 | { |
@@ -186,7 +182,7 @@ evas_preload_thread_run(void (*func_heavy) (void *data), | |||
186 | 182 | ||
187 | eina_threads_init(); | 183 | eina_threads_init(); |
188 | 184 | ||
189 | if (pthread_create(&pth->thread, NULL, _evas_preload_thread_worker, pth) == 0) | 185 | if (eina_thread_create(&pth->thread, EINA_THREAD_BACKGROUND, -1, _evas_preload_thread_worker, pth)) |
190 | { | 186 | { |
191 | LKL(_mutex); | 187 | LKL(_mutex); |
192 | _threads_count++; | 188 | _threads_count++; |