1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

mbox: provide function to unset initialized mbox

This commit is contained in:
Martine Lenders 2020-11-20 13:40:44 +01:00
parent 1c036e0116
commit 12194ad9e6
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80

View File

@ -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