sched.h 622 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 __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_setscheduler(pid_t pid, int policy);
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif