Skip to content

Commit

Permalink
[wpilibc,ntcoreffi] DataLogManager: join on Stop() call (wpilibsuite#…
Browse files Browse the repository at this point in the history
…5910)

This ensures the thread has finished prior to returning from Stop().
  • Loading branch information
PeterJohnson authored Nov 11, 2023
1 parent b6f2d3c commit 95fa5ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ntcoreffi/src/main/native/cpp/DataLogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ void DataLogManager::Start(std::string_view dir, std::string_view filename,
void DataLogManager::Stop() {
auto& inst = GetInstance();
inst.owner.GetThread()->m_log.Stop();
inst.owner.Stop();
inst.owner.Join();
}

void DataLogManager::Log(std::string_view message) {
Expand Down
2 changes: 1 addition & 1 deletion wpilibc/src/main/native/cpp/DataLogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void DataLogManager::Start(std::string_view dir, std::string_view filename,
void DataLogManager::Stop() {
auto& inst = GetInstance();
inst.owner.GetThread()->m_log.Stop();
inst.owner.Stop();
inst.owner.Join();
}

void DataLogManager::Log(std::string_view message) {
Expand Down

0 comments on commit 95fa5ec

Please sign in to comment.