ecore: remove BETA thread API integration with old Efl_Future.

This commit is contained in:
Cedric BAIL 2018-04-30 15:23:30 -07:00
parent 042de32421
commit 894c2e6c8c
2 changed files with 0 additions and 54 deletions

View File

@ -3207,17 +3207,4 @@ typedef struct _Ecore_Job Ecore_Job; /**< A job handle */
* @}
*/
#ifdef EFL_BETA_API_SUPPORT
/*
* @brief Function callback type for when creating Ecore_Thread that
* uses Efl_Future for communication.
*/
typedef void (*Ecore_Thread_Future_Cb)(const void *data, Eo *promise, Ecore_Thread *thread);
EAPI Efl_Future *ecore_thread_future_run(Ecore_Thread_Future_Cb heavy, const void *data, Eina_Free_Cb free_cb);
#endif
#endif

View File

@ -1619,44 +1619,3 @@ _ecore_thread_future_none(void *data, const Efl_Event *ev EINA_UNUSED)
// Cancelling thread if there is nobody listening on the promise anymore
ecore_thread_cancel(t);
}
EAPI Efl_Future *
ecore_thread_future_run(Ecore_Thread_Future_Cb heavy, const void *data, Eina_Free_Cb free_cb)
{
Ecore_Thread *t;
Eo *p;
if (!heavy) return NULL;
EFL_OPS_DEFINE(thread_safe_call,
EFL_OBJECT_OP_FUNC(efl_promise_value_set, _ecore_thread_value_set),
EFL_OBJECT_OP_FUNC(efl_promise_failed_set, _ecore_thread_failed_set),
EFL_OBJECT_OP_FUNC(efl_promise_progress_set, _ecore_thread_progress_set));
efl_domain_current_push(EFL_ID_DOMAIN_SHARED);
efl_wref_add(efl_add(EFL_PROMISE_CLASS, efl_main_loop_get()), &p);
if (!p) goto end;
efl_object_override(p, &thread_safe_call);
efl_key_data_set(p, "_ecore_thread.data", data);
efl_key_data_set(p, "_ecore_thread.free_cb", free_cb);
efl_key_data_set(p, "_ecore_thread.heavy", heavy);
t = ecore_thread_run(_ecore_thread_future_heavy,
_ecore_thread_future_end,
_ecore_thread_future_end,
p);
if (p)
{
efl_event_callback_add(p, EFL_PROMISE_EVENT_FUTURE_NONE, _ecore_thread_future_none, t);
efl_wref_del(p, &p);
}
end:
efl_domain_current_pop();
return p ? efl_promise_future_get(p) : NULL;
}