- EAPI Ecore_Thread *ecore_thread_run(Ecore_Cb,
- Ecore_Cb,
- Ecore_Cb,
+ EAPI Ecore_Thread *ecore_thread_run(Ecore_Thread_Heavy_Cb func_blocking,
+ Ecore_Cb func_end,
+ Ecore_Cb func_cancel,
const void *data);
- EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Heavy_Cb,
- Ecore_Thread_Notify_Cb,
- Ecore_Cb,
- Ecore_Cb,
+ EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Heavy_Cb func_heavy,
+ Ecore_Thread_Notify_Cb func_notify,
+ Ecore_Cb func_end,
+ Ecore_Cb func_cancel,
const void *data,
Eina_Bool try_no_queue);
EAPI Eina_Bool ecore_thread_cancel(Ecore_Thread *thread);
{
union {
struct {
- Ecore_Cb func_blocking;
+ Ecore_Thread_Heavy_Cb func_blocking;
} short_run;
struct {
Ecore_Thread_Heavy_Cb func_heavy;
pthread_mutex_unlock(&_ecore_pending_job_threads_mutex);
if (!work->cancel)
- work->u.short_run.func_blocking((void *) work->data);
+ work->u.short_run.func_blocking((Ecore_Thread*) work, (void *) work->data);
ecore_pipe_write(end_pipe, &work, sizeof (Ecore_Pthread_Worker *));
}
* host CPU can handle.
*/
EAPI Ecore_Thread *
-ecore_thread_run(Ecore_Cb func_blocking,
+ecore_thread_run(Ecore_Thread_Heavy_Cb func_blocking,
Ecore_Cb func_end,
Ecore_Cb func_cancel,
const void *data)
If no thread and as we don't want to break app that rely on this
facility, we will lock the interface until we are done.
*/
- func_blocking((void *)data);
+ func_blocking((Ecore_Thread *) work, (void *)data);
func_end((void *)data);
return NULL;
* will return EINA_FALSE, if the destruction is delayed or EINA_TRUE if it is
* cancelled after this call.
*
- * You should use this function only in the main loop.
+ * This function work in the main loop and in the thread, but you should not pass
+ * the Ecore_Thread variable from main loop to the worker thread in any structure.
+ * You should always use the one passed to the Ecore_Thread_Heavy_Cb.
*
* func_end, func_cancel will destroy the handler, so don't use it after.
* And if ecore_thread_cancel return EINA_TRUE, you should not use Ecore_Thread also.