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

Message ID 1517911208-3820-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • Asynchronous ordered context lock
Related show

Commit Message

Github ODP bot Feb. 6, 2018, 10 a.m.
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: 1836820278b57de6144c75872e148976d49d28a2
 ** Merge commit sha: 4a224aabaa82727f0e2038fd0361ae561e020e17
 **/
 include/odp/api/spec/schedule.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Patch

diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index d493cc75f..bbc749836 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -371,6 +371,34 @@  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 an ordered context
+ * lock acquire operation, but 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 and unlock
+ * calls, before using another lock.
+ * The same constraints apply as with odp_schedule_order_lock()
+ *
+ * @param lock_index	Index of the ordered lock in the current context to
+ *			start acquire operation.
+ *			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.
+ *
+ * @param lock_index	Index of the ordered lock in the current context to
+ *			complete acquire operation.
+ *			Must be in the range 0..odp_queue_lock_count() - 1.
+ */
+void odp_schedule_order_lock_wait(uint32_t lock_index);
+
 /**
  * @}
  */