ecore: Create a lockless ecore_animator_add()
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> SVN revision: 62373
This commit is contained in:
parent
a541e19c16
commit
25b0ab9ca7
|
@ -133,22 +133,31 @@ _do_tick(void)
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Ecore_Animator *
|
static Ecore_Animator *
|
||||||
ecore_animator_add(Ecore_Task_Cb func, const void *data)
|
_ecore_animator_add(Ecore_Task_Cb func, const void *data)
|
||||||
{
|
{
|
||||||
Ecore_Animator *animator = NULL;
|
Ecore_Animator *animator = NULL;
|
||||||
|
|
||||||
_ecore_lock();
|
if (!func) return animator;
|
||||||
if (!func) goto unlock;
|
|
||||||
animator = calloc(1, sizeof(Ecore_Animator));
|
animator = calloc(1, sizeof(Ecore_Animator));
|
||||||
if (!animator) goto unlock;
|
if (!animator) return animator;
|
||||||
ECORE_MAGIC_SET(animator, ECORE_MAGIC_ANIMATOR);
|
ECORE_MAGIC_SET(animator, ECORE_MAGIC_ANIMATOR);
|
||||||
animator->func = func;
|
animator->func = func;
|
||||||
animator->data = (void *)data;
|
animator->data = (void *)data;
|
||||||
animators = (Ecore_Animator *)eina_inlist_append(EINA_INLIST_GET(animators), EINA_INLIST_GET(animator));
|
animators = (Ecore_Animator *)eina_inlist_append(EINA_INLIST_GET(animators), EINA_INLIST_GET(animator));
|
||||||
_begin_tick();
|
_begin_tick();
|
||||||
unlock:
|
return animator;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Ecore_Animator *
|
||||||
|
ecore_animator_add(Ecore_Task_Cb func, const void *data)
|
||||||
|
{
|
||||||
|
Ecore_Animator *animator;
|
||||||
|
|
||||||
|
_ecore_lock();
|
||||||
|
animator = _ecore_animator_add(func, data);
|
||||||
_ecore_unlock();
|
_ecore_unlock();
|
||||||
|
|
||||||
return animator;
|
return animator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +168,7 @@ ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, const void *
|
||||||
|
|
||||||
_ecore_lock();
|
_ecore_lock();
|
||||||
if (runtime <= 0.0) runtime = 0.0;
|
if (runtime <= 0.0) runtime = 0.0;
|
||||||
animator = ecore_animator_add(_ecore_animator_run, NULL);
|
animator = _ecore_animator_add(_ecore_animator_run, NULL);
|
||||||
animator->data = animator;
|
animator->data = animator;
|
||||||
animator->run_func = func;
|
animator->run_func = func;
|
||||||
animator->run_data = (void *)data;
|
animator->run_data = (void *)data;
|
||||||
|
|
Loading…
Reference in New Issue