kernel: mem_slab: Add support to no multithreading

Mem_slab supports allocation with timeout which blocks the context
if no slab is available. Updated to treat every timeout as K_NO_WAIT
when multithreading is disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-04-19 08:58:13 +02:00 committed by Carles Cufí
commit 3b4b7c3a37
2 changed files with 4 additions and 2 deletions

View file

@ -4841,6 +4841,7 @@ extern int k_mem_slab_init(struct k_mem_slab *slab, void *buffer,
* This routine allocates a memory block from a memory slab.
*
* @note @a timeout must be set to K_NO_WAIT if called from ISR.
* @note When CONFIG_MULTITHREADING=n any @timeout is treated as K_NO_WAIT.
*
* @funcprops \isr_ok
*