diff mbox

[API-NEXT,PATCHv2,05/11] api: schedule: add ordered locks

Message ID 1440461669-18578-6-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Aug. 25, 2015, 12:14 a.m. UTC
Add the following APIs to support ordered locks:
odp_schedule_order_lock()
odp_schedule_order_unlock()

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 include/odp/api/schedule.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff mbox

Patch

diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
index 5837f69..8011583 100644
--- a/include/odp/api/schedule.h
+++ b/include/odp/api/schedule.h
@@ -164,6 +164,32 @@  void odp_schedule_release_atomic(void);
 void odp_schedule_release_ordered(void);
 
 /**
+ * Ordered context lock
+ *
+ * Provide reusable in-order serialization for scheduled ordered
+ * contexts. Upon return the caller is in order with respect to other events
+ * originating from the current ordered context and will retain order until a
+ * subsequent odp_schedule_order_unlock() call is made, or until order is
+ * resolved for the event via a call to odp_queue_enq() or
+ * odp_schedule_release_ordered(). This call is a no-op if the caller is not
+ * operating in an ordered context.
+ */
+void odp_schedule_order_lock(void);
+
+/**
+ * Ordered context unlock
+ *
+ * Release an ordered context lock previously acquired by
+ * odp_schedule_order_lock().  Following this call, the thread will exit the
+ * critical section protected by the ordered lock and will resume parallel
+ * execution until the next call to odp_schedule_order_lock(), or until order
+ * is resolved by a call to odp_queue_enq() or
+ * odp_schedule_release_ordered(). Note that this API is a no-op does if not
+ * called in an ordered context.
+ */
+void odp_schedule_order_unlock(void);
+
+/**
  * Prefetch events for next schedule call
  *
  * Hint the scheduler that application is about to finish processing the current