* ecore: turn on and off eina threads support when needed.

SVN revision: 53364
This commit is contained in:
Cedric BAIL 2010-10-13 16:44:15 +00:00
parent e2662d1b7c
commit 00c7021fcb
1 changed files with 14 additions and 0 deletions

View File

@ -124,6 +124,8 @@ _ecore_thread_end(Ecore_Pthread_Data *pth)
if (pthread_join(pth->thread, (void **) &p) != 0)
return ;
eina_threads_shutdown();
_ecore_active_job_threads = eina_list_remove(_ecore_active_job_threads, pth);
ecore_event_add(ECORE_THREAD_PIPE_DEL, pth->p, _ecore_thread_pipe_free, NULL);
@ -479,9 +481,13 @@ ecore_thread_run(Ecore_Cb func_blocking,
pth->p = ecore_pipe_add(_ecore_thread_handler, NULL);
if (!pth->p) goto on_error;
eina_threads_init();
if (pthread_create(&pth->thread, NULL, (void *) _ecore_thread_worker, pth) == 0)
return (Ecore_Thread *) work;
eina_threads_shutdown();
on_error:
if (pth)
{
@ -562,6 +568,8 @@ ecore_thread_cancel(Ecore_Thread *thread)
work->func_cancel((void *) work->data);
free(work);
eina_threads_shutdown();
return EINA_TRUE;
}
}
@ -578,6 +586,8 @@ ecore_thread_cancel(Ecore_Thread *thread)
work->func_cancel((void *) work->data);
free(work);
eina_threads_shutdown();
return EINA_TRUE;
}
}
@ -698,9 +708,13 @@ EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Heavy_Cb func_heavy,
pth->p = ecore_pipe_add(_ecore_thread_handler, NULL);
if (!pth->p) goto on_error;
eina_threads_init();
if (pthread_create(&pth->thread, NULL, (void *) _ecore_thread_worker, pth) == 0)
return (Ecore_Thread *) worker;
eina_threads_shutdown();
on_error:
if (pth)
{