forked from enlightenment/efl
parent
0e7accd2ba
commit
a1c4588d64
|
@ -45,20 +45,25 @@ eio_long_file_set(Eio_File *common,
|
||||||
Ecore_Cb end_cb,
|
Ecore_Cb end_cb,
|
||||||
Ecore_Cb cancel_cb)
|
Ecore_Cb cancel_cb)
|
||||||
{
|
{
|
||||||
|
Ecore_Thread *thread;
|
||||||
|
|
||||||
common->done_cb = done_cb;
|
common->done_cb = done_cb;
|
||||||
common->error_cb = error_cb;
|
common->error_cb = error_cb;
|
||||||
common->data = data;
|
common->data = data;
|
||||||
common->error = 0;
|
common->error = 0;
|
||||||
common->thread = NULL;
|
common->thread = NULL;
|
||||||
|
|
||||||
/* Be aware that ecore_thread_run could call cancel_cb if something goes wrong. */
|
/* Be aware that ecore_thread_run could call cancel_cb if something goes wrong.
|
||||||
common->thread = ecore_thread_feedback_run(heavy_cb,
|
This means that common would be destroyed if thread == NULL.
|
||||||
notify_cb,
|
*/
|
||||||
end_cb,
|
thread = ecore_thread_feedback_run(heavy_cb,
|
||||||
cancel_cb,
|
notify_cb,
|
||||||
common,
|
end_cb,
|
||||||
EINA_TRUE);
|
cancel_cb,
|
||||||
return !!common->thread;
|
common,
|
||||||
|
EINA_TRUE);
|
||||||
|
if (thread) common->thread = thread;
|
||||||
|
return !!thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
|
@ -70,15 +75,21 @@ eio_file_set(Eio_File *common,
|
||||||
Ecore_Cb end_cb,
|
Ecore_Cb end_cb,
|
||||||
Ecore_Cb cancel_cb)
|
Ecore_Cb cancel_cb)
|
||||||
{
|
{
|
||||||
|
Ecore_Thread *thread;
|
||||||
|
|
||||||
common->done_cb = done_cb;
|
common->done_cb = done_cb;
|
||||||
common->error_cb = error_cb;
|
common->error_cb = error_cb;
|
||||||
common->data = data;
|
common->data = data;
|
||||||
common->error = 0;
|
common->error = 0;
|
||||||
common->thread = NULL;
|
common->thread = NULL;
|
||||||
|
|
||||||
/* Be aware that ecore_thread_run could call cancel_cb if something goes wrong. */
|
/* Be aware that ecore_thread_run could call cancel_cb if something goes wrong.
|
||||||
common->thread = ecore_thread_run(job_cb, end_cb, cancel_cb, common);
|
This means that common would be destroyed if thread == NULL.
|
||||||
return !!common->thread;
|
*/
|
||||||
|
thread = ecore_thread_run(job_cb, end_cb, cancel_cb, common);
|
||||||
|
|
||||||
|
if (thread) common->thread = thread;
|
||||||
|
return !!thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- */
|
/* --- */
|
||||||
|
|
Loading…
Reference in New Issue