Initialize channel memory in parallel

When there are a large amount of channels, it takes a while to map them
and make sure there are pages behind them and owned by starterd.  This
turns out to be many seconds on larger systems.  This can be done in
parallel, and achieves a 50+% speedup on that part of the startup
process.

Change-Id: Id45e279b3dcd19e7d81c3b5b75ef324519f3721a
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/starter/starterd_lib.h b/aos/starter/starterd_lib.h
index 946e135..775cdbc 100644
--- a/aos/starter/starterd_lib.h
+++ b/aos/starter/starterd_lib.h
@@ -78,6 +78,11 @@
   const int max_status_count_;
 
   std::unordered_map<std::string, Application> applications_;
+
+  // Lock and list of all the queues.  This makes it so we can initialize the
+  // queues in parallel, and also so starterd owns the memory for all the
+  // queues from cgroup's point of view.
+  std::mutex queue_mutex_;
   std::vector<std::unique_ptr<aos::ipc_lib::MemoryMappedQueue>> shm_queues_;
 
   // Capture the --shm_base flag at construction time.  This makes it much