summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/cache/evas_preload.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-10-19 10:56:34 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-10-19 10:56:34 +0000
commit10f9d3a21567bde6927d3a9d710cfe53526419ad (patch)
tree29b0169e917dc5e8b3ffe009c3bda6617f53777e /legacy/evas/src/lib/cache/evas_preload.c
parentd84053ccfe811f4ef979d0e87ef33b378b1afa0b (diff)
evas: move to Eina_Thread.
SVN revision: 78245
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/cache/evas_preload.c12
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
33struct _Evas_Preload_Pthread_Data 32struct _Evas_Preload_Pthread_Data
34{ 33{
35 pthread_t thread; 34 Eina_Thread thread;
36}; 35};
37 36
38static int _threads_count = 0; 37static 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
68static void * 67static 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);
77on_error: 73on_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++;