Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sched.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef ZEPHYR_INCLUDE_POSIX_SCHED_H_
7#define ZEPHYR_INCLUDE_POSIX_SCHED_H_
8
9#include <zephyr/kernel.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/*
16 * Other mandatory scheduling policy. Must be numerically distinct. May
17 * execute identically to SCHED_RR or SCHED_FIFO. For Zephyr this is a
18 * pseudonym for SCHED_RR.
19 */
20#define SCHED_OTHER 0
21
22/* Cooperative scheduling policy */
23#define SCHED_FIFO 1
24
25/* Priority based preemptive scheduling policy */
26#define SCHED_RR 2
27
28#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
29 || defined(CONFIG_ARCMWDT_LIBC)
30struct sched_param {
31 int sched_priority;
32};
33#endif
34
40static inline int sched_yield(void)
41{
42 k_yield();
43 return 0;
44}
45
46int sched_get_priority_min(int policy);
47int sched_get_priority_max(int policy);
48
49#ifdef __cplusplus
50}
51#endif
52
53#endif /* ZEPHYR_INCLUDE_POSIX_SCHED_H_ */
void k_yield(void)
Yield the current thread.
Public kernel APIs.
static int sched_yield(void)
Yield the processor.
Definition: sched.h:40
int sched_get_priority_min(int policy)
int sched_get_priority_max(int policy)