diff mbox series

[API-NEXT,v2,1/2] api: schedule: add asynchronous order lock

Message ID 1517846409-7604-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v2,1/2] api: schedule: add asynchronous order lock | expand

Commit Message

Github ODP bot Feb. 5, 2018, 4 p.m. UTC
From: Balasubramanian Manoharan <bala.manoharan@linaro.org>


add asynchronous order lock api. schedule order context lock can be
acquired asynchronously using two functions start and wait. application can
utilize the cycles between these functions to increase performance.

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

---
/** Email created from pull request 453 (bala-manoharan:async_order_lock)
 ** https://github.com/Linaro/odp/pull/453
 ** Patch: https://github.com/Linaro/odp/pull/453.patch
 ** Base sha: fa6d104f6031b9687ae5f60f87f5c2338ad9a83e
 ** Merge commit sha: a50f50ab2e9af13052f4d9dc7d962b8c0c111868
 **/
 include/odp/api/spec/schedule.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index d493cc75f..ef8de9415 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -371,6 +371,30 @@  void odp_schedule_order_unlock(uint32_t lock_index);
  */
 void odp_schedule_order_unlock_lock(uint32_t unlock_index, uint32_t lock_index);
 
+/** Asynchronous ordered context lock
+ * Request an ordered context lock to be acquired. Starts to acquire an ordered
+ * context lock does not wait until the lock has been acquired. Application can
+ * use this call to potentially interleave some processing within waiting for
+ * this lock. Each start lock call must be paired with a wait call that blocks
+ * until the lock has been acquired. Locks cannot be acquired in nested fashion
+ * i.e each start call must follow a paring wait call before the next ordered
+ * context lock call (both sync and async).
+ * The same constraints apply as with odp_schedule_order_lock()
+ *
+ * @param lock_index	Index of the ordered lock in the current context to be
+ *			acquired. Must be in the range 0..odp_queue_lock_count()
+ *			- 1.
+ *
+ */
+void odp_schedule_order_lock_start(uint32_t lock_index);
+
+/** Asynchronous ordered context lock wait
+ * wait for a previously started lock acquire operation to finish.
+ * Lock index must match with the previous start call. Ordered lock acquisition
+ * will be completed during this call.
+ */
+void odp_schedule_order_lock_wait(uint32_t lock_index);
+
 /**
  * @}
  */