Use the first available CPU instead of 0 and 1
This makes the test work in docker containers.
Change-Id: I21a93e59434182ba50ef8c9ea45e24dc0e79a617
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/realtime.cc b/aos/realtime.cc
index dc53a37..c58e2e6 100644
--- a/aos/realtime.cc
+++ b/aos/realtime.cc
@@ -176,6 +176,12 @@
}
}
+cpu_set_t GetCurrentThreadAffinity() {
+ cpu_set_t result;
+ PCHECK(sched_getaffinity(0, sizeof(result), &result) == 0);
+ return result;
+}
+
void SetCurrentThreadRealtimePriority(int priority) {
if (FLAGS_skip_realtime_scheduler) {
LOG(WARNING) << "Ignoring request to switch to the RT scheduler due to "