Merge "Attempt to raise the soft rlimit before going realtime"
diff --git a/aos/realtime.cc b/aos/realtime.cc
index 558417f..ff05f32 100644
--- a/aos/realtime.cc
+++ b/aos/realtime.cc
@@ -133,6 +133,10 @@
// Make sure we will only be allowed to run for 3 seconds straight.
SetSoftRLimit(RLIMIT_RTTIME, 3000000, SetLimitForRoot::kYes);
+ // Raise our soft rlimit if necessary.
+ SetSoftRLimit(RLIMIT_RTPRIO, priority, SetLimitForRoot::kNo,
+ AllowSoftLimitDecrease::kNo);
+
struct sched_param param;
param.sched_priority = priority;
PCHECK(sched_setscheduler(0, SCHED_FIFO, ¶m) == 0)