summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-12-07 12:15:16 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2018-12-07 12:23:11 +0100
commit33c00de365ab8ed2adebd86e5e3dc6091afc0fa9 (patch)
treefe0abdfc084f80f3c2c997f0ccfab2d5d45f3b25 /src/lib/ecore
parente6f66e56fdc0989e73fc54809dea5368df68cfab (diff)
eo: make efl_future_then have a data pointer in addition of the object pointer.
Summary: In the case when you have multiple future in flight related to one object, you couldn't use the previous version of efl_future_then. Now all function calls take a void* pointer that allow multiple future to have their private data request data accessible in all the callback. This should not break released API as Eo.h is not released yet and so was efl_future_Eina_FutureXXX_then. Depends on D7332 Reviewers: felipealmeida, segfaultxavi, vitor.sousa, SanghyeonLee, bu5hm4n Reviewed By: segfaultxavi Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7472 Differential Revision: https://phab.enlightenment.org/D7379
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_io_copier.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/ecore/efl_io_copier.c b/src/lib/ecore/efl_io_copier.c
index 28f5ab68aa..a03168807c 100644
--- a/src/lib/ecore/efl_io_copier.c
+++ b/src/lib/ecore/efl_io_copier.c
@@ -72,7 +72,7 @@ static void _efl_io_copier_read(Eo *o, Efl_Io_Copier_Data *pd);
72 while (0) 72 while (0)
73 73
74static Eina_Value 74static Eina_Value
75_efl_io_copier_timeout_inactivity_cb(Eo *o, const Eina_Value v) 75_efl_io_copier_timeout_inactivity_cb(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
76{ 76{
77 Eina_Error err = ETIMEDOUT; 77 Eina_Error err = ETIMEDOUT;
78 efl_event_callback_call(o, EFL_IO_COPIER_EVENT_ERROR, &err); 78 efl_event_callback_call(o, EFL_IO_COPIER_EVENT_ERROR, &err);
@@ -86,12 +86,12 @@ _efl_io_copier_timeout_inactivity_reschedule(Eo *o, Efl_Io_Copier_Data *pd)
86 if (pd->timeout_inactivity <= 0.0) return; 86 if (pd->timeout_inactivity <= 0.0) return;
87 87
88 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), pd->timeout_inactivity), 88 efl_future_then(o, efl_loop_timeout(efl_loop_get(o), pd->timeout_inactivity),
89 .success = _efl_io_copier_timeout_inactivity_cb, 89 .success = _efl_io_copier_timeout_inactivity_cb,
90 .storage = &pd->inactivity_timer); 90 .storage = &pd->inactivity_timer);
91} 91}
92 92
93static Eina_Value 93static Eina_Value
94_efl_io_copier_job(Eo *o, const Eina_Value v) 94_efl_io_copier_job(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
95{ 95{
96 Efl_Io_Copier_Data *pd = efl_data_scope_get(o, MY_CLASS); 96 Efl_Io_Copier_Data *pd = efl_data_scope_get(o, MY_CLASS);
97 uint64_t old_read = pd->progress.read; 97 uint64_t old_read = pd->progress.read;
@@ -138,14 +138,14 @@ _efl_io_copier_job_schedule(Eo *o, Efl_Io_Copier_Data *pd)
138 { 138 {
139 Eina_Value v = EINA_VALUE_EMPTY; 139 Eina_Value v = EINA_VALUE_EMPTY;
140 140
141 v = _efl_io_copier_job(o, v); 141 v = _efl_io_copier_job(o, NULL, v);
142 eina_value_flush(&v); 142 eina_value_flush(&v);
143 } 143 }
144 else 144 else
145 { 145 {
146 efl_future_then(o, efl_loop_job(efl_loop_get(o)), 146 efl_future_then(o, efl_loop_job(efl_loop_get(o)),
147 .success = _efl_io_copier_job, 147 .success = _efl_io_copier_job,
148 .storage = &pd->job); 148 .storage = &pd->job);
149 } 149 }
150} 150}
151 151