sched.h 513 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __SCHED_H__
  2. #define __SCHED_H__
  3. #include <rtthread.h>
  4. #include <sys/types.h>
  5. #include <errno.h>
  6. /* Thread scheduling policies */
  7. enum
  8. {
  9. SCHED_OTHER = 0,
  10. SCHED_FIFO,
  11. SCHED_RR,
  12. SCHED_MIN = SCHED_OTHER,
  13. SCHED_MAX = SCHED_RR
  14. };
  15. struct sched_param
  16. {
  17. int sched_priority;
  18. };
  19. #ifdef __cplusplus
  20. extern "C"
  21. {
  22. #endif
  23. int sched_yield(void);
  24. int sched_get_priority_min(int policy);
  25. int sched_get_priority_max(int policy);
  26. int sched_setscheduler(pid_t pid, int policy);
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif