summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_promise.c (unfollow)
AgeCommit message (Collapse)Author
2016-06-03eina: protect promise death during callbacks cancel.Cedric BAIL
2016-06-03eina: Add NULL checks and EINA_MAGIC checks to promisesFelipe Magno de Almeida
Add NULL checks and EINA_MAGIC checks that avoid crashing when it shouldn't.
2016-06-03eina: Remove Eina_Promise* parameter in promise callbackFelipe Magno de Almeida
Remove not very useful parameter to eina_promise_then callbacks.
2016-06-03eina: Remove unnecessary indirection to promisesFelipe Magno de Almeida
Now when dealing with pointer types, we will not get pointer to pointer semantics in callbacks and eina_promise_owner_value_set for Eina_Promise. It will work as expected: Eina_Promise_Owner* promise = eina_promise_add(); void* p = malloc(sizeof(T)); eina_promise_owner_value_set(promise, p, &free);
2016-06-03Eina: Fix eina_promise_all refcount ordering problemLarry Jr
The call to eina_promise_then steals the first ref'count, so it is possible that the promise is freed after the eina_promise_then, so we need to eina_promise_ref before eina_promise_then.
2016-05-31eina: don't access dead promise.Cedric BAIL
We do properly unref promise while calling all the then callback. There is no need to check it a second time (which actually lead to a 100% bad access). T3759
2016-05-26eina: Make cancelled promises use EINA_ERROR_PROMISE_CANCELLED error codeFelipe Magno de Almeida
2016-05-26eina: Use pointer directly instead of by unnecessary indirectionFelipe Magno de Almeida
2016-05-26eina: Fix crashing when accessing past-the-end of the malloc'ed promiseFelipe Magno de Almeida
The promise race composition was calculating its size wrongly, making the promise's size smaller than it should, causing heap corruption.
2016-05-26eina: Fix then callbacks prototypesFelipe Magno de Almeida
Eina_Error is not passed by pointer anymore, which could cause invalid pointer access in promise compositions (all and race). Also added Eina_Promise* to prototypes.
2016-05-26eina: Add missing buffer_get function in Eina_PromiseFelipe Magno de Almeida
Function buffer_get was available only in Eina_Promise_Owner, despite being defined in both classes.
2016-05-25eina: Add promise parameter to then calllbacksFelipe Magno de Almeida
Added promise parameter to then callbacks so callbacks can steal ownership of the value from the promise.
2016-05-09eina: Add eina_promise_race composition functionFelipe Magno de Almeida
Added eina_promise_race function that composes multiple promise objects into a new promise which is fulfilled when one of the promises are fulfilled, or fails when one of the promises have failed.
2016-05-07eina: Fix memory leaks in promiseFelipe Magno de Almeida
2016-05-06eina: Add progress notify callback feature for Promise OwnersFelipe Magno de Almeida
Add a way for users of the promise owner to get notified when a promise progress is registered. Also added a convenience composition function that creates a promise which is fulfilled when another promise has a progress notification.
2016-04-13eina: Fix promise error with eina_promise_allFelipe Magno de Almeida
Fix value_set and error_set signatures which were receiving a owner. They actually receive the promise and not the owner, this caused wrong access to memory and were not visible by warnings because the functions are casted. This problem caused errors in which it seemed that promise had actually error'ed when questioned it.
2016-04-05eina: add promiseFelipe Magno de Almeida
Add a promise object that will allows Eolian interface to include promises as a way to have asynchronous value return and composibility. To understand better, let see the coming usage in a .eo file: class Foo { methods { bar { params { @inout promise: Promise<int>; } } } } Which will create the following API interface: void foo_bar(Eo* obj, Eina_Promise** promise); and the equivalent declaration for implementation. However, the API function will instantiate the Promise for the user and the implementer of the class automatically. So the user of this function will treat it as a @out parameter, while the developer of the function will treat it like a @inout parameter. So, the user will use this function like this: Eina_Promise* promise; // No need to instantiate foo_bar(obj, &promise); eina_promise_then(promise, callback); Signed-off-by: Cedric Bail <cedric@osg.samsung.com>