From 69ea3a55429942f281baa488467aa32bdd84cc70 Mon Sep 17 00:00:00 2001 From: dario Date: Sat, 2 Dec 2023 20:21:10 +0100 Subject: [PATCH] Removed waiting forever for state transitions --- Tacos/src/statemachine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tacos/src/statemachine.cpp b/Tacos/src/statemachine.cpp index a3b0227..a5c4609 100644 --- a/Tacos/src/statemachine.cpp +++ b/Tacos/src/statemachine.cpp @@ -72,8 +72,9 @@ namespace sta transition.event = EventFlags::NORMAL; transition.lockout = lockout; - // TODO: For how should we wait here? - queue_.put(transition); + // Try to add a state transition request to the queue. Don't wait if another + // thread is already requesting a state change. + queue_.put(transition, 0); } void Statemachine::requestTimedStateTransition(uint32_t from, uint32_t to, uint32_t millis, uint32_t lockout /* = 0 */)