completion.h 604 B

12345678910111213141516171819202122232425262728293031
  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. #include <rtthread.h>
  12. /**
  13. * Completion
  14. */
  15. struct rt_completion
  16. {
  17. rt_uint32_t flag;
  18. /* suspended list */
  19. rt_list_t suspended_list;
  20. };
  21. void rt_completion_init(struct rt_completion *completion);
  22. rt_err_t rt_completion_wait(struct rt_completion *completion,
  23. rt_int32_t timeout);
  24. void rt_completion_done(struct rt_completion *completion);
  25. #endif