diff --git a/wpilibc/src/main/native/cpp/smartdashboard/SmartDashboard.cpp b/wpilibc/src/main/native/cpp/smartdashboard/SmartDashboard.cpp index 5e70a4c64d..1fdf22f890 100644 --- a/wpilibc/src/main/native/cpp/smartdashboard/SmartDashboard.cpp +++ b/wpilibc/src/main/native/cpp/smartdashboard/SmartDashboard.cpp @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2011-2019 FIRST. All Rights Reserved. */ +/* Copyright (c) 2011-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -257,7 +257,7 @@ void SmartDashboard::PostListenerTask(std::function task) { void SmartDashboard::UpdateValues() { auto& registry = SendableRegistry::GetInstance(); auto& inst = Singleton::GetInstance(); + listenerExecutor.RunListenerTasks(); std::scoped_lock lock(inst.tablesToDataMutex); for (auto& i : inst.tablesToData) registry.Update(i.getValue()); - listenerExecutor.RunListenerTasks(); } diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java index 1b022c18b0..e68b867e78 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java @@ -528,10 +528,10 @@ public final class SmartDashboard { * Puts all sendable data to the dashboard. */ public static synchronized void updateValues() { + // Execute posted listener tasks + listenerExecutor.runListenerTasks(); for (Sendable data : tablesToData.values()) { SendableRegistry.update(data); } - // Execute posted listener tasks - listenerExecutor.runListenerTasks(); } }