Simplify aos::Init
Most of the variants were to deal with core, which has been gone for a
year. Simplify those all into InitGoogle.
InitGoogle should be renamed to Init at some point. It does everything
now.
Change-Id: I738ee03e9c5b2e6348ef33302835f915df68011f
diff --git a/aos/ipc_lib/eventfd_latency.cc b/aos/ipc_lib/eventfd_latency.cc
index d146c13..47f6528 100644
--- a/aos/ipc_lib/eventfd_latency.cc
+++ b/aos/ipc_lib/eventfd_latency.cc
@@ -43,7 +43,13 @@
// Sleep between 1 and 15 ms.
::std::uniform_int_distribution<> distribution(1000, 15000);
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_sender_priority);
while (true) {
const monotonic_clock::time_point wakeup_time =
@@ -117,7 +123,13 @@
}
});
- PinCurrentThreadToCPU(FLAGS_core);
+ {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ CPU_SET(FLAGS_core, &cpuset);
+
+ SetCurrentThreadAffinity(cpuset);
+ }
SetCurrentThreadRealtimePriority(FLAGS_receiver_priority);
epoll.Run();
UnsetCurrentThreadRealtimePriority();