Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dmn-runtime-state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ void Dmn_Runtime_State::setEndManaged() {

void Dmn_Runtime_State::cancel() {
bool completeNow{};

{
std::lock_guard lock{m_mutex};

Expand Down Expand Up @@ -243,6 +244,7 @@ bool Dmn_Runtime_State::isRunning() const {

bool Dmn_Runtime_State::beginStep() {
bool callOnStarted{};

{
std::lock_guard lock{m_mutex};

Expand Down Expand Up @@ -270,6 +272,7 @@ void Dmn_Runtime_State::complete(Terminal_State terminalState,
bool callOnCompleted{};
bool callOnFailed{};
bool callOnCancelled{};

{
std::lock_guard lock{m_mutex};

Expand Down Expand Up @@ -319,6 +322,7 @@ void Dmn_Runtime_State::complete(Terminal_State terminalState,

void Dmn_Runtime_State::resetQueuedAfterSubmission() {
bool completeNow{};

{
std::lock_guard lock{m_mutex};

Expand Down Expand Up @@ -482,6 +486,7 @@ void Dmn_Runtime_State_Manager::executeStateStep(

void Dmn_Runtime_State_Manager::releaseState(const Dmn_Runtime_State *state) {
std::lock_guard lock{m_pendingStatesMutex};

m_pendingStates.erase(state);
}

Expand Down
4 changes: 2 additions & 2 deletions src/dmn-state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

#include <cassert>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

namespace dmn {

Expand Down Expand Up @@ -93,6 +91,7 @@ auto Dmn_State::runNext() -> bool {

void Dmn_State::setEnd() {
beforeSetEnd();

m_next = static_cast<int>(m_states.size());
}

Expand All @@ -109,6 +108,7 @@ void Dmn_State::setNext(int index) {

void Dmn_State::setNext() {
beforeSetNext();

assert(m_next >= 0 && m_next < static_cast<int>(m_states.size()));
m_next++;
}
Expand Down
2 changes: 1 addition & 1 deletion test/dmn-test-runtime-state.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright © 2024 - 2025 Chee Bin HOH. All rights reserved.
* Copyright © 2026 Chee Bin HOH. All rights reserved.
*
* @file dmn-test-runtime-state.cpp
* @brief Unit tests for runtime-managed state lifecycle and scheduling.
Expand Down
2 changes: 1 addition & 1 deletion test/dmn-test-state.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright © 2024 - 2025 Chee Bin HOH. All rights reserved.
* Copyright © 2026 Chee Bin HOH. All rights reserved.
*
* @file dmn-test-state.cpp
* @brief Unit tests for Dmn_State lifecycle and user-state transitions.
Expand Down
Loading