Skip to content

Commit ebce119

Browse files
committed
Clarify event freeing in dispatch, post and publish APIs
1 parent f765665 commit ebce119

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libs/ao/ao.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ bool am_ao_publish_x_exclude(
225225
*
226226
* If the active object's event queue is full the function crashes with assert.
227227
*
228+
* The library takes care of freeing the event once the
229+
* active object handled the event.
230+
*
228231
* The function is fast, thread safe and usable from
229232
* interrupt service routines (ISR).
230233
*
@@ -243,6 +246,9 @@ void am_ao_post_fifo(struct am_ao *ao, const struct am_event *event);
243246
*
244247
* Tries to free the event, if it was not posted.
245248
*
249+
* The library takes care of freeing the event once the
250+
* active object handled the event.
251+
*
246252
* Statically allocated events (events for which am_event_is_static()
247253
* returns true) are never freed.
248254
*
@@ -265,6 +271,9 @@ bool am_ao_post_fifo_x(
265271
*
266272
* The event is then handled asynchronously by the active object.
267273
*
274+
* The library takes care of freeing the event once the
275+
* active object handled the event.
276+
*
268277
* If active object's event queue is full the function crashes with assert.
269278
*
270279
* The function is fast, thread safe and usable from
@@ -285,6 +294,9 @@ void am_ao_post_lifo(struct am_ao *ao, const struct am_event *event);
285294
*
286295
* Tries to free the event, if it was not posted.
287296
*
297+
* The library takes care of freeing the event once the
298+
* active object handled the event.
299+
*
288300
* Statically allocated events (events for which am_event_is_static()
289301
* returns true) are never freed.
290302
*

libs/hsm/hsm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ struct am_hsm {
283283
/**
284284
* Synchronous dispatch of event to a given HSM.
285285
*
286+
* Does not free the event - this is caller's responsibility.
287+
*
286288
* @param hsm the HSM handler
287289
* @param event the event to dispatch
288290
*/

0 commit comments

Comments
 (0)