Remove easy uses of //aos/mutex
I was hoping to get rid of it completely as one of the nontrivial users
of AOS_LOG, but need to write a compatible condition variable first.
Change-Id: I86c1c4084882bf789baabd0255e115d821154830
diff --git a/y2020/BUILD b/y2020/BUILD
index 38832b8..208b04a 100644
--- a/y2020/BUILD
+++ b/y2020/BUILD
@@ -55,8 +55,8 @@
visibility = ["//visibility:public"],
deps = [
"//aos/logging",
- "//aos/mutex",
"//aos/network:team_number",
+ "//aos/stl_mutex",
"//frc971:constants",
"//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem",
"//y2020/control_loops/drivetrain:polydrivetrain_plants",
diff --git a/y2020/constants.cc b/y2020/constants.cc
index 131b0de..d39e1cd 100644
--- a/y2020/constants.cc
+++ b/y2020/constants.cc
@@ -10,8 +10,8 @@
#include "absl/base/call_once.h"
#include "aos/logging/logging.h"
-#include "aos/mutex/mutex.h"
#include "aos/network/team_number.h"
+#include "aos/stl_mutex/stl_mutex.h"
#include "y2020/control_loops/superstructure/control_panel/integral_control_panel_plant.h"
#include "y2020/control_loops/superstructure/hood/integral_hood_plant.h"
#include "y2020/control_loops/superstructure/intake/integral_intake_plant.h"
@@ -156,8 +156,8 @@
}
const Values &GetValuesForTeam(uint16_t team_number) {
- static ::aos::Mutex mutex;
- ::aos::MutexLocker locker(&mutex);
+ static aos::stl_mutex mutex;
+ std::unique_lock<aos::stl_mutex> locker(mutex);
// IMPORTANT: This declaration has to stay after the mutex is locked to
// avoid race conditions.