mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
🎯 Sync smart & scheduler codes (#8537)
Signed-off-by: Shell <smokewood@qq.com> Co-authored-by: xqyjlj <xqyjlj@126.com>
This commit is contained in:
@@ -13,18 +13,22 @@
|
||||
#include <rtconfig.h>
|
||||
|
||||
/**
|
||||
* Completion
|
||||
* Completion - A tiny IPC implementation for resource-constrained scenarios
|
||||
*
|
||||
* It's an IPC using one CPU word with the encoding:
|
||||
*
|
||||
* BIT | MAX-1 ----------------- 1 | 0 |
|
||||
* CONTENT | suspended_thread & ~1 | completed flag |
|
||||
*/
|
||||
|
||||
struct rt_completion
|
||||
{
|
||||
rt_uint32_t flag;
|
||||
|
||||
/* suspended list */
|
||||
rt_list_t suspended_list;
|
||||
struct rt_spinlock spinlock;
|
||||
/* suspended thread, and completed flag */
|
||||
rt_base_t susp_thread_n_flag;
|
||||
};
|
||||
|
||||
#define RT_COMPLETION_INIT(comp) {0}
|
||||
|
||||
void rt_completion_init(struct rt_completion *completion);
|
||||
rt_err_t rt_completion_wait(struct rt_completion *completion,
|
||||
rt_int32_t timeout);
|
||||
|
||||
Reference in New Issue
Block a user