mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
sched: Map SCHED_OTHER to SCHED_FIFO or SCHED_RR
this behaviour is explicitly specified here: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_08.html and map SCHED_NORMAL to SCHED_OTHER like Linux: https://man7.org/linux/man-pages/man7/sched.7.html Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
2ad0a02182
commit
631a8da1e2
@@ -37,11 +37,7 @@
|
||||
|
||||
/* Default pthread attribute initializer */
|
||||
|
||||
#if CONFIG_RR_INTERVAL == 0
|
||||
# define PTHREAD_DEFAULT_POLICY SCHED_FIFO
|
||||
#else
|
||||
# define PTHREAD_DEFAULT_POLICY SCHED_RR
|
||||
#endif
|
||||
#define PTHREAD_DEFAULT_POLICY SCHED_NORMAL
|
||||
|
||||
/* A lot of hassle to use the old-fashioned struct initializers. But this
|
||||
* gives us backward compatibility with some very old compilers.
|
||||
|
||||
+2
-1
@@ -41,10 +41,11 @@
|
||||
|
||||
/* POSIX-like scheduling policies */
|
||||
|
||||
#define SCHED_NORMAL 0 /* Alias to SCHED_OTHER */
|
||||
#define SCHED_OTHER 0 /* Map to SCHED_FIFO or SCHED_RR */
|
||||
#define SCHED_FIFO 1 /* FIFO priority scheduling policy */
|
||||
#define SCHED_RR 2 /* Round robin scheduling policy */
|
||||
#define SCHED_SPORADIC 3 /* Sporadic scheduling policy */
|
||||
#define SCHED_OTHER 4 /* Not supported */
|
||||
|
||||
/* Maximum number of SCHED_SPORADIC replenishments */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user