forked from enlightenment/efl
* ecore: remove thread from the correct list.
SVN revision: 53029
This commit is contained in:
parent
21a7dde012
commit
05262d2120
|
@ -507,12 +507,15 @@ ecore_thread_cancel(Ecore_Thread *thread)
|
|||
|
||||
if (!work)
|
||||
return EINA_TRUE;
|
||||
if (work->cancel)
|
||||
return EINA_FALSE;
|
||||
|
||||
pthread_mutex_lock(&_ecore_pending_job_threads_mutex);
|
||||
|
||||
if ((have_main_loop_thread) &&
|
||||
(pthread_equal(main_loop_thread, pthread_self())))
|
||||
{
|
||||
if (!work->feedback_run)
|
||||
EINA_LIST_FOREACH(_ecore_pending_job_threads, l, work)
|
||||
{
|
||||
if ((void *) work == (void *) thread)
|
||||
|
@ -525,6 +528,22 @@ ecore_thread_cancel(Ecore_Thread *thread)
|
|||
work->func_cancel((void *) work->data);
|
||||
free(work);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
EINA_LIST_FOREACH(_ecore_pending_job_threads_feedback, l, work)
|
||||
{
|
||||
if ((void *) work == (void *) thread)
|
||||
{
|
||||
_ecore_pending_job_threads_feedback = eina_list_remove_list(_ecore_pending_job_threads_feedback, l);
|
||||
|
||||
pthread_mutex_unlock(&_ecore_pending_job_threads_mutex);
|
||||
|
||||
if (work->func_cancel)
|
||||
work->func_cancel((void *) work->data);
|
||||
free(work);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue