diff options
author | Matias Elo <matias.elo@nokia.com> | 2023-06-16 14:18:04 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-07-07 14:05:08 +0300 |
commit | 544a3f17d8cd12c59af7e40663737cf88e3f51fb (patch) | |
tree | 921c5ef6d36a1d80f438688051516ab2cfe4c634 /include/odp/api/spec/timer.h | |
parent | 2ccd3aebb00c4af401f82ddd6763809dd49ac418 (diff) |
api: timer: add odp_timeout_from_event_multi() function
Add new odp_timeout_from_event_multi() function for converting multiple
events of type ODP_EVENT_TIMEOUT to timeout handles. This can improve
throughput compared to calling odp_timeout_from_event() multiple times.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Acked-by: Ashwin Sekhar T K <asekhar@marvell.com>
Diffstat (limited to 'include/odp/api/spec/timer.h')
-rw-r--r-- | include/odp/api/spec/timer.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index bbb439692..a50817c27 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -1,5 +1,5 @@ /* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia + * Copyright (c) 2019-2023, Nokia * * All rights reserved. * @@ -478,6 +478,17 @@ int odp_timer_cancel(odp_timer_t timer, odp_event_t *tmo_ev); odp_timeout_t odp_timeout_from_event(odp_event_t ev); /** + * Convert multiple timeout events to timeout handles + * + * All events must be of type ODP_EVENT_TIMEOUT. + * + * @param[out] tmo Timeout handle array for output + * @param ev Array of event handles to convert + * @param num Number of timeouts and events + */ +void odp_timeout_from_event_multi(odp_timeout_t tmo[], const odp_event_t ev[], int num); + +/** * Convert timeout handle to event handle * * @param tmo Timeout handle |