sched.h 681 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #ifndef __SCHED_H__
  10. #define __SCHED_H__
  11. #include <rtthread.h>
  12. #include <pthread.h>
  13. /* Thread scheduling policies */
  14. enum
  15. {
  16. SCHED_OTHER = 0,
  17. SCHED_FIFO,
  18. SCHED_RR,
  19. SCHED_MIN = SCHED_OTHER,
  20. SCHED_MAX = SCHED_RR
  21. };
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. int sched_yield(void);
  27. int sched_get_priority_min(int policy);
  28. int sched_get_priority_max(int policy);
  29. int sched_rr_get_interval(pid_t pid, struct timespec *tp);
  30. int sched_setscheduler(pid_t pid, int policy);
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif