From 12194ad9e6ce267c8d8d30e3aa9ac8e77c961633 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 20 Nov 2020 13:40:44 +0100 Subject: [PATCH] mbox: provide function to unset initialized mbox --- core/include/mbox.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/include/mbox.h b/core/include/mbox.h index 62a4392711..121b9ae65a 100644 --- a/core/include/mbox.h +++ b/core/include/mbox.h @@ -185,6 +185,17 @@ static inline size_t mbox_avail(mbox_t *mbox) return cib_avail(&mbox->cib); } +/** + * @brief Unset's the mbox, effectively deinitializing and invalidating it. + * + * @param[in] mbox ptr to mailbox to operate on + */ +static inline void mbox_unset(mbox_t *mbox) +{ + mbox->msg_array = NULL; + mbox->cib.mask = 0; +} + #ifdef __cplusplus } #endif