2018-10-14 19:37:18 +08:00
|
|
|
/*
|
2023-04-18 10:26:23 +08:00
|
|
|
* Copyright (c) 2006-2023, RT-Thread Development Team
|
2018-10-14 19:37:18 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
*/
|
2017-10-15 22:56:46 +08:00
|
|
|
#ifndef COMPLETION_H_
|
|
|
|
#define COMPLETION_H_
|
|
|
|
|
2023-07-29 06:26:51 +08:00
|
|
|
#include <rtdef.h>
|
|
|
|
#include <rtconfig.h>
|
2017-10-15 22:56:46 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Completion
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct rt_completion
|
|
|
|
{
|
|
|
|
rt_uint32_t flag;
|
|
|
|
|
|
|
|
/* suspended list */
|
|
|
|
rt_list_t suspended_list;
|
2023-10-25 20:31:25 +08:00
|
|
|
struct rt_spinlock spinlock;
|
2017-10-15 22:56:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
void rt_completion_init(struct rt_completion *completion);
|
|
|
|
rt_err_t rt_completion_wait(struct rt_completion *completion,
|
|
|
|
rt_int32_t timeout);
|
|
|
|
void rt_completion_done(struct rt_completion *completion);
|
|
|
|
|
|
|
|
#endif
|