Skip to content

Commit

Permalink
Implement AdvanceableRunner::isRunning() method
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi committed Aug 12, 2021
1 parent ab08db8 commit 2c4d578
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/System/include/BipedalLocomotion/System/AdvanceableRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ template <class _Advanceable> class AdvanceableRunner
* @return true in case of success, false otherwise
*/
void stop();

/**
* Check if the AdvanceableRunner is running
* @return true if the thread is running, false otherwise.
*/
bool isRunning() const;
};

template <class _Advanceable>
Expand Down Expand Up @@ -331,6 +337,12 @@ template <class _Advanceable> void AdvanceableRunner<_Advanceable>::stop()
m_isRunning = false;
}

template <class _Advanceable> bool AdvanceableRunner<_Advanceable>::isRunning() const
{
// m_isRunning is an atomic<bool> the mutex is not required here
return m_isRunning;
}

template <class _Advanceable>
typename AdvanceableRunner<_Advanceable>::Info AdvanceableRunner<_Advanceable>::getInfo()
{
Expand Down

0 comments on commit 2c4d578

Please sign in to comment.