1
0

completion.h 656 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2006-2023, 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 <rtdef.h>
  12. #include <rtconfig.h>
  13. /**
  14. * Completion
  15. */
  16. struct rt_completion
  17. {
  18. rt_uint32_t flag;
  19. /* suspended list */
  20. rt_list_t suspended_list;
  21. struct rt_spinlock spinlock;
  22. };
  23. void rt_completion_init(struct rt_completion *completion);
  24. rt_err_t rt_completion_wait(struct rt_completion *completion,
  25. rt_int32_t timeout);
  26. void rt_completion_done(struct rt_completion *completion);
  27. #endif