[wpilib] Fix deadlocks in Mechanism2d et al. (#3770)

UpdateEntries() and Flush() are called from methods that lock the mutex,
so locking it again will cause deadlocks. This also updates the Java
code to make MechanismObject2d::update synchronized like in the C++
version.
This commit is contained in:
Prateek Machiraju
2021-12-06 17:42:02 -05:00
committed by GitHub
parent acb64dff97
commit d81ef2bc5c
6 changed files with 8 additions and 7 deletions

View File

@@ -21,7 +21,6 @@ MechanismLigament2d::MechanismLigament2d(std::string_view name, double length,
void MechanismLigament2d::UpdateEntries(
std::shared_ptr<nt::NetworkTable> table) {
std::scoped_lock lock(m_mutex);
table->GetEntry(".type").SetString("line");
m_colorEntry = table->GetEntry("color");