aboutsummaryrefslogtreecommitdiff
path: root/apps/systemlib
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-10-03 23:13:20 -0700
committerpx4dev <px4@purgatory.org>2012-10-03 23:13:20 -0700
commitdfae108e6aff6e77eb05def50d99fb5c6d2c28c8 (patch)
tree57478848a3c87b66978eef5ae986882aed93b598 /apps/systemlib
parent216aa20ac278c55931d618bb2ebf8b7bc1a3614b (diff)
downloadpx4-firmware-dfae108e6aff6e77eb05def50d99fb5c6d2c28c8.tar.gz
px4-firmware-dfae108e6aff6e77eb05def50d99fb5c6d2c28c8.tar.bz2
px4-firmware-dfae108e6aff6e77eb05def50d99fb5c6d2c28c8.zip
Go back to the FIFO scheduler for now, as we don't have time to shake out the RR scheduler changeover just yet.
Make the "default" scheduler a centralized definition so that changes are easier in future.
Diffstat (limited to 'apps/systemlib')
-rw-r--r--apps/systemlib/systemlib.c3
-rw-r--r--apps/systemlib/systemlib.h7
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/systemlib/systemlib.c b/apps/systemlib/systemlib.c
index 3d46a17a8..94a5283f0 100644
--- a/apps/systemlib/systemlib.c
+++ b/apps/systemlib/systemlib.c
@@ -138,9 +138,8 @@ int task_spawn(const char *name, int scheduler, int priority, int stack_size, ma
param.sched_priority = priority;
sched_setscheduler(pid, scheduler, &param);
- /* XXX do any other private task accounting here */
+ /* XXX do any other private task accounting here before the task starts */
}
-
sched_unlock();
return pid;
diff --git a/apps/systemlib/systemlib.h b/apps/systemlib/systemlib.h
index da1524435..997f40ded 100644
--- a/apps/systemlib/systemlib.h
+++ b/apps/systemlib/systemlib.h
@@ -50,6 +50,13 @@ __EXPORT int reboot(void);
/** Sends SIGUSR1 to all processes */
__EXPORT void killall(void);
+/** Default scheduler type */
+#if CONFIG_RR_INTERVAL > 0
+# define SCHED_DEFAULT SCHED_RR
+#else
+# define SCHED_DEFAULT SCHED_FIFO
+#endif
+
/** Starts a task and performs any specific accounting, scheduler setup, etc. */
__EXPORT int task_spawn(const char *name,
int priority,