1 /* 2 * Copyright (c) 2006-2018, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 */ 9 #ifndef COMPLETION_H_ 10 #define COMPLETION_H_ 11 12 #include <rtthread.h> 13 14 /** 15 * Completion 16 */ 17 18 struct rt_completion 19 { 20 rt_uint32_t flag; 21 22 /* suspended list */ 23 rt_list_t suspended_list; 24 }; 25 26 void rt_completion_init(struct rt_completion *completion); 27 rt_err_t rt_completion_wait(struct rt_completion *completion, 28 rt_int32_t timeout); 29 void rt_completion_done(struct rt_completion *completion); 30 31 #endif 32