2013-06-26 23:18:30 +08:00
|
|
|
/*
|
2021-03-08 18:19:04 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2013-06-26 23:18:30 +08:00
|
|
|
*
|
2018-10-14 19:28:18 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2013-06-26 23:18:30 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
*/
|
|
|
|
|
2010-11-18 07:35:13 +08:00
|
|
|
#ifndef __SCHED_H__
|
|
|
|
#define __SCHED_H__
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
2011-02-21 16:26:35 +08:00
|
|
|
#include <pthread.h>
|
2010-11-18 07:35:13 +08:00
|
|
|
|
|
|
|
/* Thread scheduling policies */
|
|
|
|
enum
|
|
|
|
{
|
2013-06-26 23:18:30 +08:00
|
|
|
SCHED_OTHER = 0,
|
|
|
|
SCHED_FIFO,
|
|
|
|
SCHED_RR,
|
|
|
|
SCHED_MIN = SCHED_OTHER,
|
|
|
|
SCHED_MAX = SCHED_RR
|
2010-11-18 07:35:13 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int sched_yield(void);
|
|
|
|
int sched_get_priority_min(int policy);
|
|
|
|
int sched_get_priority_max(int policy);
|
2021-12-17 15:34:17 +08:00
|
|
|
int sched_rr_get_interval(pid_t pid, struct timespec *tp);
|
2010-11-18 07:35:13 +08:00
|
|
|
int sched_setscheduler(pid_t pid, int policy);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|