summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-09-11 16:09:43 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-09-11 16:09:43 -0700
commitfa9acf8b356b4e6d5ae899770b64f98e1f1a67f0 (patch)
tree72b15c51d3ce667098ae1d8eb85aeb00919dd4d3 /src
parent54083a7835af895d32b230d3f8d4c70aa2798773 (diff)
eina: add eina_promise_data_set symetric to eina_promise_data_get.
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_promise.c9
-rw-r--r--src/lib/eina/eina_promise.h11
2 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c
index 1cbc9f274f..1fbac60f65 100644
--- a/src/lib/eina/eina_promise.c
+++ b/src/lib/eina/eina_promise.c
@@ -998,6 +998,15 @@ eina_promise_data_get(const Eina_Promise *p)
998 return (void *)p->data; 998 return (void *)p->data;
999} 999}
1000 1000
1001EAPI void
1002eina_promise_data_set(Eina_Promise *p,
1003 void *data)
1004{
1005 EINA_SAFETY_ON_NULL_RETURN(p);
1006 p->data = data;
1007}
1008
1009
1001static Eina_Value 1010static Eina_Value
1002_eina_future_cb_easy(void *data, const Eina_Value value, 1011_eina_future_cb_easy(void *data, const Eina_Value value,
1003 const Eina_Future *dead_future) 1012 const Eina_Future *dead_future)
diff --git a/src/lib/eina/eina_promise.h b/src/lib/eina/eina_promise.h
index 9c8fc3a8a2..caca9574a9 100644
--- a/src/lib/eina/eina_promise.h
+++ b/src/lib/eina/eina_promise.h
@@ -554,6 +554,17 @@ EAPI Eina_Promise *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promi
554EAPI void *eina_promise_data_get(const Eina_Promise *p) EINA_ARG_NONNULL(1); 554EAPI void *eina_promise_data_get(const Eina_Promise *p) EINA_ARG_NONNULL(1);
555 555
556/** 556/**
557 * Sets the data attached to the promise.
558 *
559 * Set the data passed to eina_promise_new().
560 * @see eina_promise_new()
561 * @see eina_promise_resolve()
562 * @see eina_promise_reject()
563 * @see eina_promise_as_value()
564 */
565EAPI void eina_promise_data_set(Eina_Promise *p, void *data) EINA_ARG_NONNULL(1);
566
567/**
557 * Resolves a promise. 568 * Resolves a promise.
558 * 569 *
559 * 570 *