diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2022-04-13 12:29:06 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2022-05-06 13:22:03 +0300 |
commit | 12a96596d7f977e7a55cd487d9969f905afc1209 (patch) | |
tree | f2ca40477bff3c47e765f117232442f48ef096e5 | |
parent | 8c2dd30da54b1ee069415a9f6d94162943cb87ad (diff) |
api: schedule: introduce odp_schedule_order_wait()
Introduce odp_schedule_order_wait() what waits until the calling thread
is "at the head of the source queue", i.e. until no other thread (nor
the source queues nor the scheduler) holds an ordered scheduling context
that has the same source queue and precedes the ordered scheduling context
of the calling thread.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
-rw-r--r-- | include/odp/api/spec/schedule.h | 15 | ||||
-rw-r--r-- | include/odp/api/spec/schedule_types.h | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h index 524d9e2bf..29db262c0 100644 --- a/include/odp/api/spec/schedule.h +++ b/include/odp/api/spec/schedule.h @@ -547,6 +547,21 @@ void odp_schedule_order_lock_start(uint32_t lock_index); void odp_schedule_order_lock_wait(uint32_t lock_index); /** + * Wait until the currently held scheduling context is the first in order + * + * Wait until there are no other scheduling contexts that precede the + * scheduling context of the calling thread in the source queue order. + * The context remains the first in order until the thread releases it. + * + * This function must not be called if the current thread is not holding + * an ordered scheduling context or if an ordered lock is being held. + * + * This functions does nothing if ordered wait is not supported. + * @see odp_schedule_capability() + */ +void odp_schedule_order_wait(void); + +/** * Print debug info about scheduler * * Print implementation defined information about scheduler to the ODP log. diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h index 09d812528..b90cd5062 100644 --- a/include/odp/api/spec/schedule_types.h +++ b/include/odp/api/spec/schedule_types.h @@ -225,6 +225,10 @@ typedef struct odp_schedule_capability_t { * The specification is the same as for the blocking implementation. */ odp_support_t waitfree_queues; + /** Order wait support. If not supported, odp_schedule_order_wait() + * does nothing. */ + odp_support_t order_wait; + } odp_schedule_capability_t; /** |