mm/iob: add support of alloc with timeout iob_timedalloc()

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2022-02-17 12:34:36 +08:00
committed by Alan Carvalho de Assis
parent 4824ea68a9
commit 0b18cfbd9a
2 changed files with 63 additions and 6 deletions
+17
View File
@@ -233,6 +233,23 @@ struct iob_userstats_s
void iob_initialize(void);
/****************************************************************************
* Name: iob_timedalloc
*
* Description:
* Allocate an I/O buffer by taking the buffer at the head of the free list.
* This wait will be terminated when the specified timeout expires.
*
* Input Parameters:
* throttled - An indication of the IOB allocation is "throttled"
* timeout - Timeout value in milliseconds.
* consumerid - id representing who is consuming the IOB
*
****************************************************************************/
FAR struct iob_s *iob_timedalloc(bool throttled, unsigned int timeout,
enum iob_user_e consumerid);
/****************************************************************************
* Name: iob_alloc
*